jobesystems
Posts: 3
Joined: Mon Jun 24, 2013 4:38 am

Relays, GPIOs, and PiFace

Mon Jul 01, 2013 4:29 am

Hey all,

So I'm testing some code and I'm reading GPIOs just fine, but when I try to write to the relays they aren't working.

wiringpi2.digitalWrite(216,1) is what I'm using to set Relay 1 to closed. Is that not the correct format?
wiringpi2.digitalWrite(216,0) is what I'm using to set Realy 1 to open.

Also, does anyone have any guidance on using wiringpi2 to monitor GPIOs so that I can automatically trigger things? I was going to use RPIO and interrupts, but RPIO doesn't seem to support PiFace. I'm going to have another system connected via IP socket and I don't want it to have to keep sending strings periodically to "poll" the GPIOs.

Thanks.

Mike

PiGraham
Posts: 3939
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Relays, GPIOs, and PiFace

Mon Jul 01, 2013 4:58 am

Have you read this?
https://projects.drogon.net/raspberry-pi/wiringpiface/

Piface outputs are different to Pi outputs. Make sure you initialise correctly.

Return to “Python”