Jetson GIOP pins are not responding as per the sample code

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
# 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
    while True:
        # Toggle the output every second
        print("Outputting {} to pin {}".format(curr_value, output_pin))
        GPIO.output(output_pin, curr_value)
        curr_value ^= GPIO.HIGH

if name == ‘main’:

hello viswanath580,

according to your sample code, it’ll take 20-seconds for your first high/low pin state changes.
however, it looks curr_value ^= GPIO.HIGH return true or false instead of GPIO states.
you might have a try to report GPIO state directly.

Hi Jerry,

Would you mind providing with a sample code or a road map to control a GPIO pin to switch it on when I send a signal . I am pretty much new to this space .

hello viswanath580,

please refer to Topic 144550,
there’re several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.