You need to set the pin as an output before you use it.
To do that add the following line:
GPIO.setup(red, GPIO.OUT)
below the matching lines for green and yellow:
GPIO.setup(yellow, GPIO.OUT) ## set output
GPIO.setup(green, GPIO.OUT)
2 of 2 | fix minor typo | ||||
You need to set the pin as an output before you use it. To do that add the following line:
below the matching lines for green and yellow:
|