Using an old hard drive cable, I built a GPIO breakout cable then proceed to make an LED blink... a classic 'Hello World' of electronics. I followed this diagram for the connections.
image from Embedded Linux Wiki
Plug the wires and follow these steps:
- Boot the Raspberry Pi
- Login as root (embrace your dark side)
- Getting ready to output in GPIO4:
- $ echo "4" > /sys/class/gpio/export
$ echo "out" > /sys/class/gpio/gpio4/direction - Turn GPIO4 on:
$ echo "1" > /sys/class/gpio/gpio4/value - Turn GPIO4 off:
$ echo "0" > /sys/class/gpio/gpio4/value
Tada!
I'm now using WiringPI c++ library. Here's a good reference to get started at Limina.Log. And a good pins reference table.
Những Chuyến Đi Cuộc Đời
ReplyDeleteNgau Hung Du Lich
Tri Thức Du Lịch
Book Ve Du Lich Gia Re
This comment has been removed by the author.
ReplyDeletegoogle 3797
ReplyDeletegoogle 3798
google 3799
google 3800
google 3801