1 1
djmcg

GPIO Orange PI WIN PLus

Recommended Posts

Hello

Could You advice how to steering my GPIO output

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

I already have the connect but can`t fine tutorial on web how to do it.

 

 

Snap72.jpg

Snap73.jpg

Share this post


Link to post
Share on other sites
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 ...

Share this post


Link to post
Share on other sites
7 minutes ago, djmcg said:

Look`s like not work

Sorry, I did some typos, it should be :

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

 

Share this post


Link to post
Share on other sites
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

 

 

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites

Could You help me

When i turn on/off the 37 port in

gpio readall

The port 31 is change

Could You advice what`s happen

see screen

 

Snap83.jpg

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1