|
Post by cybertek007 on Sept 17, 2013 14:21:49 GMT -8
Ok I now have your demo page setup to talk to my RPi What pins on the Demo are connected to the app buttons
I was hoping to be able to run some relays off of the RPi your demo has lights on/off, Stereo On/Off,Fireplace On/Off,Feed Cat,Sprinklers On/Off as well as Sound Alert that does nothing!
I would like to link then to the RPi board output pins
I have looked every where and can not find any documentation or examples
Please Advise
|
|
|
Post by SDL on Sept 17, 2013 14:52:51 GMT -8
Hi Cybertek007,
Yes, lots of people are hooking this up to the real world. We have people driving other computers, robots, watering systems and other devices. You can wire up those buttons to any code you wish in Local.py as described in the documentation. They are not connected to anything in the demo.
Here is the code for a button that blinks an LED connected to a GPIO pin on the Pi. It is a good example of how to do this. Add this to your Local.py file as described in the documentation.
# object Type match if (objectType == ACTION_BUTTON_UITYPE):
if (Config.debug()): print "ACTION_BUTTON_UTYPE of %s found" % objectServerID
# B-2 - flash an LED on the Pi, located on GPIO 25 if (objectServerID == "B-2"):
#check for validate request # validate allows RasPiConnect to verify this object is here if (validate == "YES"): outgoingXMLData += Validate.buildValidateResponse("YES") outgoingXMLData += BuildResponse.buildFooter() return outgoingXMLData
# not validate request, so execute
GPIO.setup(22, GPIO.OUT) GPIO.output(22, False) time.sleep(0.5) GPIO.output(22, True)
responseData = "OK" outgoingXMLData += BuildResponse.buildResponse(responseData) outgoingXMLData += BuildResponse.buildFooter() return outgoingXMLData
Hope that helps!
Best regards,
BP
|
|