please choosego to mobile | Continue to access the PC version
View: 10895|Reply: 1

Writing to GPIO pins on Orange Pi Zero with Mono

[Copy link]

2

threads

2

posts

26

credits

Novice

Rank: 1

credits
26
Published in 2019-7-10 20:47:04 | Show all floors |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

27

threads

58

posts

2164

credits

Gold member

Rank: 6Rank: 6

credits
2164
Published in 2019-11-1 04:05:32 | Show all floors
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 code
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list