Hi All,
I am trying to run the sample codes from jetson GPIO repo. I have modified the code and running it but pins are not responding as expected. As per the below code pin, 12 should change its state to LOW and HIGH for every 10 seconds, when I execute the code PIN’s state is not changing to LOW. Can someone help me with this
import RPi.GPIO as GPIO
import time
Pin Definitions
output_pin = 12 # BOARD pin 12, BCM pin 18
def main():
# Pin Setup:
# Board pin-numbering scheme
GPIO.setmode(GPIO.BOARD)
# set pin as an output pin with optional initial state of HIGH
GPIO.setup(output_pin, GPIO.OUT, initial=GPIO.HIGH)
print("Starting demo now! Press CTRL+C to exit")
curr_value = GPIO.HIGH
try:
while True:
time.sleep(10)
# Toggle the output every second
print("Outputting {} to pin {}".format(curr_value, output_pin))
GPIO.output(output_pin, curr_value)
curr_value ^= GPIO.HIGH
finally:
GPIO.cleanup()
if name == ‘main’:
main()