Jump to content

Recommended Posts

Posted

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

Posted
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 ...

Posted
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

 

Posted
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

 

 

Posted
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

 

Posted

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

Posted
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...

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines