OLIMEX© 2012
OLinuXino-MICRO user's manual
2.8 How to blink the LED
In this sub-chapter you will find a way to achieve the most basic task in electronics – the “Hello
World” of electronics - blinking the LED.
First we set the pin responsible for the LED as an output and we can set its value manually to high
or low position – make it blink manually. The LED mounted on the board uses GPIO65. You can
use external diode instead of the one mounted - you have to look at the table “The Linux
implementation of pins” in the hardware section to get the correct linux name for the GPIO pin.
echo out > /sys/class/gpio/gpio65/direction
echo 1 > /sys/class/gpio/gpio65/value
If you want to set the blink off you should change the value on the second line to:
echo 0 > /sys/class/gpio/gpio65/value
To show the info for all GPIOs:
ls /sys/class/gpio
To make it turn on – turn off automatically (e.g. blink) we use the text redactor VI to write the
Linux script:
echo out > /sys/class/gpio/gpio65/direction
while true
do
echo 1 > /sys/class/gpio/gpio65/value
sleep 1
echo 0 > /sys/class/gpio/gpio65/value
sleep 1
done
We save it as as “gpio” and we make it executable with
chmod +x gpio
then we execut the script with:
./gpio
The LED should start blinking with 0.5Hz.
2.9 How to setup Arch Linux distribution
You can refer to the manual of OLinuXino-MAXI for general build instructions but mind we
haven't tested the algorithm listed there on the MICRO. There shouldn't be significant differences. If
you meet such head over to the OLIMEX forums.
Page 13 of 47
Summary of Contents for OLinuXino-MICRO
Page 16: ...OLIMEX 2012 OLinuXino MICRO user s manual 3 1 Layout top view Page 16 of 47 ...
Page 17: ...OLIMEX 2012 OLinuXino MICRO user s manual 3 2 Layout bottom view Page 17 of 47 ...
Page 22: ...OLIMEX 2012 OLinuXino MICRO user s manual Page 22 of 47 ...
Page 38: ...OLIMEX 2012 OLinuXino MICRO user s manual 7 2 Processor block diagram Page 38 of 47 ...
Page 39: ...OLIMEX 2012 OLinuXino MICRO user s manual 7 3 Physical memory map Page 39 of 47 ...