traffic.py
import Adafruit_BBIO.GPIO as g
import Adafruit_BBIO.GPIO as g
g.setup("P8_10",g.OUT)
g.setup("P8_14",g.OUT)
g.setup("P8_16",g.OUT)
#g.setup("P8_10",g.OUT)
import time
while True :
g.output("P8_10",g.HIGH)
# g.output("P8_9",g.HIGH)
g.output("P8_14",g.LOW)
g.output("P8_16",g.LOW)
time.sleep(5)
g.output("P8_14",g.HIGH)
g.output("P8_16",g.LOW)
g.output("P8_10",g.LOW)
# g.output("P8_9",g.LOW)
time.sleep(5)
~ g.output("P8_14",g.LOW)
g.output("P8_16",g.HIGH)
g.output("P8_10",g.LOW)
# g.output("P8_9",g.LOW)
what is "g" here,if it is an object then where is its corresponding class ?
ReplyDeleteCheck the change. Tell if you need further explanation.
DeleteThanks for bringing my attention to it.
Whether it is a complete one code or a module.....
ReplyDeleteIt is the complete code Jenit. P8_10,P8_14 and P8_16 pins of the BBB are connected to green, yellow and red led bulbs respectively.
DeleteCan i have a look over the output pease....
ReplyDeleteSorry Aman
DeleteI don't have a BBB anymore to show you the output. But try implementing the code with one and you will understand the output.