OLIMEX© 2015
IMX233-OLinuXino-MINI user's manual
need to install dependencies needed for the compile/build scripts. Here are some (but not all) of the
mandatory ones: G++; diffstat; texi2html; chrpath; gawk; texinfo; some git client.
To ensure you have the latest version supported with all the updates visit
https://github.com/OLIMEX/OLINUXINO
and
https://github.com/Freescale/fsl-community-bsp-
platform
.
2.7 How to blink the LED
In this 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:
Page 13 of 46