setup is RPI3 with on pin 4 i have a relay connected (sainsmart board)
Code: Select all
#!/bin/python
import RPI.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(4, GPIO.out)
try:
while True:
GPIO.output(4, GPIO.1)
sleep(.2)
GPIO.output(4, GPIO.0)
except KeyboardInterrupt:
GPIO.output(4, GPIO.1)
IndentationError: expected an indented block
What is wrong with my code?
Some code start with #!/bin/python
others with #!/usr/bin/python
what is the difference or best?