I am new to the Jetson AGX Orin Dev Kit, so forgive me if I am a novice.
I am trying to control a couple of motors and solenoids with the GPIO output of the AGX Orin however I cannot seem to figure out what the pinout of the GPIO pins are? I am coding with C++ so I know that for example GPIO Pin32 is not actually named pin 32 in the code, but something else. How do I find this and control it with the code.
This is the code I am using right now, you can see I am trying to assign pin 456 which from this pinout link i thought was GPIO Pin32…
I could imagine that this method is very slow and might not work for motor control.
There is an official GPIO library from Nvidia, but it’s only available for Python. You may try this library for example, which is an unofficial port for C++.
Thanks for the reply. I installed the unofficial version of GPIO for C++ and went through setting up an example test to see if I could turn off and on (real pin 13) GPIO32, but there was no change of output. The multimeter I put across pin 13 and the GND on pin 9 just reads a constant 0V.
So I tried to use (real pin 16) GPIO08 and that worked when I used 16 as the pin number in the code.. Is PIN32 being used for something for something else and that is why I cannot control it?
I was able to get this working, but I realised for another application I needed Ubuntu 22.04. So I flashed the AGX Orin DevKit with the SDK, following the instructions from the SDK Manager and when I tried to rerun the previously working code, I got this error:
sudo ./gpio_test
terminate called after throwing an instance of 'std::runtime_error'
what(): [Exception] [Exception] could not open directory: /sys/bus/platform/devices/2200000.gpio/gpio (catched from: GPIO::get_data())
(catched from: setmode())
Aborted
It seems like the GPIO pins aren’t ‘seen’ anymore right? Is there a way to fix this or can I reset back to the original factory flash with Ubuntu 20.04?
So I attempted to follow the tutorial in the link you sent. I ran
gpioset gpiofind "PDD.02"=1
Then ran
gpioget gpiofind "PDD.02"
and got an output of 1 as expected. I then used gpioset to set the value to 0, but when I ran the gpioget command again it still said ‘1’ as the output.
I also tried to create a simple python script based on the Jetson.GPIO library linked, but that also did not work. Any ideas? I just need to set 8 solenoids to on/off on command. If there is an easier way to get this done I am open to that as well. Thanks!