Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 550|Reply: 1

Writing to GPIO pins on Orange Pi Zero with Mono

[Copy link]

2

Threads

2

Posts

22

Credits

Novice

Rank: 1

Credits
22
Post time 2019-7-10 20:47:04 | Show all posts |Read mode
Hi


I wrote a Mono app for Armbian Ubuntu running on an Orange Pi Zero to read incoming telemetry data from the serial port.That part is working fine, but I now need to activate one of the pins on the GPIO. I simply have to occasionally set pin 19 to high for about a second and then clear it again.
Unfortunately, I'm struggling quite a bit with this. Whereas reading the serial port was relatively easy, I'm quite lost on writing to a GPIO pin with Mono.
If any one has any pointers I'd greatly appreciate it. Perhaps a sample or an idea of which library I should be using would be greatly appreciated. Thank you

23

Threads

50

Posts

653

Credits

Senior member

Rank: 4

Credits
653
Post time 2019-11-1 04:05:32 | Show all posts
In Armbian, something like the following would set the GPIO's

  1. # echo "5" >/sys/class/gpio/export
  2. # echo "out" >/sys/class/gpio/gpio5/direction
  3. # echo "1" > /sys/class/gpio/gpio5/value
Copy the Code
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-11-13 02:27 GMT+8 , Processed in 0.027468 second(s), 22 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list