Jump to content

Trying to mess with my gpio but I keep getting a gay error. I dont understand the error? Ive checked spelling like 6 times. When I try and run it it highlights the bolded gpio in red and doesnt tell me the exact error.

 

#blink.py
import time
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)
GPIO.setup(4. GPIO.OUT)
GPIO.output(4. True)
time.sleep(1)
GPIO.output(4. False)
 

I like pie.

Link to comment
https://linustechtips.com/topic/873390-syntax-error/
Share on other sites

Link to post
Share on other sites

The code looks like it should turn on for a second and then back off, you need a loop if you want it to blink.

Also, I can't be sure if you've connected everything up correctly, or are even running the script itself.

 

You have to give more details about your problem and setup, not just "It doesn't work."

Link to comment
https://linustechtips.com/topic/873390-syntax-error/#findComment-10824103
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×