Blinking LEDs with Intel Galileo, Yocto and shell script

Using shell script to control LEDs from the Yocto system powering the Intel Galileo board. Using the documentation from Sergey’s Blog. Full shell script bellow:

#!/bin/sh

# gpio17 = Galileo pin 5
# gpio24 = Galileo pin 6
# gpio27 = Galileo pin 7

for i in 17 24 27; do
  echo out > /sys/class/gpio/gpio$i/direction
  echo strong > /sys/class/gpio/gpio$i/drive
done

for i in `seq 5`; do
  echo 0 > /sys/class/gpio/gpio17/value
  echo 0 > /sys/class/gpio/gpio24/value
  echo 0 > /sys/class/gpio/gpio27/value
  sleep 1
  echo 1 > /sys/class/gpio/gpio17/value
  echo 1 > /sys/class/gpio/gpio24/value
  echo 1 > /sys/class/gpio/gpio27/value
  sleep 1
done 
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s