I am pretty much a noob but looking to move on up. I am wokring on a project to and thought i had all i needed until i installed blynk on my iphone.
bascially i have writen a script using python to click an relay on for 1.5 seconds then turn off after. when teh relay kicks on and turns off that is acting the same way as if I take my transmitter for my car and pressed the remote start button to start my van.
Here is my problem, if I run the script from python all works perfect and van starts. But when i run it from Blynk app on my iphone the button stays on until i turn it off again but this cause the remote start to fail and it shuts the van off.
My question is how do i get this corrected? I am thinking i need to have a button within blynk that will act like a momentary button not a push on push off or switch on switch off type… Is this even possible?
Any help or guidance would be appreciated greatly…
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# init list with pin numbers
pinList = [17,]
# loop through pins and set mode and state to 'low'
for i in pinList:
GPIO.setup(i, GPIO.OUT)
GPIO.output(i, GPIO.HIGH)
# time to sleep between operations in the main loop
SleepTimeL = 1.5
# main loop
try:
GPIO.output(17, GPIO.LOW)
GPIO.output(17, GPIO.HIGH)
print "ONE"
time.sleep(SleepTimeL);
GPIO.cleanup()
print "Good bye!"
# End program cleanly with keyboard
except KeyboardInterrupt:
print " Quit"
# Reset GPIO settings
GPIO.cleanup()
sorry i really am a new guy to this coding thing but i am willing to learn because it seems very fun. Can you please explain a bit more dumb it down for me a bit? I know that hand holding isn’t really accepted but i could use all the help.
what did i do wrong that you are saying i didn’t format correctly? everything seems to be working when i run the script.