How To Blink The Led - OLIMEX OLinuXino-MAXI User Manual

Open-source single-board linux computer
Hide thumbs Also See for OLinuXino-MAXI:
Table of Contents

Advertisement

OLIMEX© 2012
OLinuXino User's Manual
5) Now to start building the image:
~fsl-community-bsp$:. ./setup-environment build
~fsl-community-bsp/build $: bitbake core-image-minimal
Note: on different Linux distributions you might have different tools installed and you will probably
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 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
Page 12 of 48

Advertisement

Table of Contents
loading

Table of Contents