How to control GPIO on Jetson_nano_emmc?

I want to set GPIO2(model pin 124) GPIO3(model pin 126) as output pin,and also i can set it to be Hige or Low,so what need I to do?

hello CN_MKLS_YUAN ,

you may control them via sysnode, please also check this discussion thread, Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.

Hi CN_MKLS_YUAN,

If you want to just set them from terminal maybe you can use these commands:

sudo sh -c "echo 124 > /sys/class/gpio/export"
sudo sh -c "echo out > /sys/class/gpio/gpio124/direction"
sudo sh -c "echo 1 > /sys/class/gpio/gpio124/value" # High
sudo sh -c "echo 0 > /sys/class/gpio/gpio124/value" # Low

You can check the status of the GPIOs using:

sudo cat /sys/kernel/debug/gpio

Regards,
Roberto,

Hi robertogs2&JerryChang
Thanks for your help
According to JerryChang’s instructions and combining robertogs2 's instructions, I have been able to successfully control GPIO02 and GPIO03.
But I want to use an APP to monitor the data of the system and control the GPIO to give feedback on the data. I haven’t thought of how to solve it.
I have only recently started to use NANO, and I don’t know much about programming, haha

Hello CN_MKLS_YUAN,

In the topic provided by JerryChang, there is a reference to a Python Package that I think you can use as a start for your application: Jetson GPIO. Maybe that could help you start developing it by using Python, by following the instructions and the samples there.

Best regards,
Roberto

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.