[elektro] raspi peldak

Kiss Gabor kissg at ssg.ki.iif.hu
Fri Mar 13 10:08:04 CET 2015


On 03/13/2015 09:48 AM, Erdos Zoltan wrote:
> nem, tanulas.
> 
> hogy a human lassa tavolrol egy erzekelo kontakt allapotat, es hogy
> tudjon valamit bekapcsolni..
> mint amikor az ember uj procinal, feljeszto eszkoznel is a led
> villogtatassal kezdi...
> en legalabbis nem szulettem zseninek, hogy nullarol ip-stackot
> programozzak :-)

Ja, értem.
Én így csinálnám, ha be kellene lőnöm a programot/vasat:

# ls -lL /sys/class/gpio
total 0
-rwxrwx--- 1 root gpio 4096 Mar 13 10:04 export
drwxrwx--- 3 root gpio    0 Jan  1  1970 gpiochip0
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 unexport
#

# echo 22 >/sys/class/gpio/export

# ls -lL /sys/class/gpio
total 0
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 export
drwxrwx--- 3 root gpio    0 Mar 13 10:05 gpio22
drwxrwx--- 3 root gpio    0 Jan  1  1970 gpiochip0
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 unexport
#

# ls -lL /sys/class/gpio/gpio22
total 0
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 active_low
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 direction
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 edge
drwxrwx--- 2 root gpio    0 Mar 13 10:05 power
drwxrwx--- 2 root gpio    0 Mar 13 10:05 subsystem
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 uevent
-rwxrwx--- 1 root gpio 4096 Mar 13 10:05 value
#

# cat /sys/class/gpio/gpio22/value
0
#

és ha már nem kell:

# echo 22 >/sys/class/gpio/unexport


Itt elindulhatsz:
http://www.raspberrypi.org/documentation/usage/gpio/
https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio
http://elinux.org/RPi_Low-level_peripherals

De van itt neked web felület is:
http://code.google.com/p/webiopi/

kissg
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the Elektro mailing list