Jump to content
  • 0

GPIO Orange PI WIN PLus


djmcg
 Share

Question

10 answers to this question

Recommended Posts

  • 0
1 hour ago, djmcg said:

I need set "+" for this 4 canal 31 33 35 37

You could use gpio sysfs as it is the most easy way.

pin31,33,35,37 are respectively PB5,PB6,PB7 and PD5. In gpio sysfs, they becomes gpio37,gpio38,gpio39 and gpio101.

Here are the command to turn a gpio37 into output and set level output state :

echo 37 > /sys/class/gpio/export
echo "out" > /sys/class/gpio37/direction
echo 1 > /sys/class/gpio37/value

Simply repeat the code for other gpios ...

Link to comment
Share on other sites

Check forum guidelines to use maximum potential!

  • 0
8 minutes ago, martinayotte said:

Simple ...


echo 0 > /sys/class/gpio/gpio37/value

 

Hello I just  tested with parameter "0" not work, but

 

echo 37 > /sys/class/gpio/export 

  - init option to work (on ,off)

 

echo "out" > /sys/class/gpio/gpio37/direction

  - turn On

echo 1 > /sys/class/gpio/gpio37/value

   - turn Off

 

Thank You

 

 

Link to comment
Share on other sites

  • 0
6 minutes ago, djmcg said:

now 0 work correctly

Good !

Simple bash script to toogle every half seconds :

#!/bin/bash

echo 37 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio37/direction

while true; do
	echo 0 > /sys/class/gpio/gpio37/value
	sleep 0.5
	echo 1 > /sys/class/gpio/gpio37/value
	sleep 0.5
done

 

Link to comment
Share on other sites

  • 0
2 hours ago, djmcg said:

The port 31 is change

What do you means, there is no such pins for 31, neither than 29,33,35, gpio numbers are the ones in the BCM column ... So that is why sysfs gives errors.

For "gpio readall" outputs, it is reflecting the reality when you change value of 37, the V columns is appearing accordingly...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...