Saturday, February 6, 2016

Slice of Pi

Today was the first day I opened my Raspberry Pi. Upon my first time opening it I was given the task of making an LED turn on via a bread board and command lines. The positive side of the LED connected to GPIO2 and the negative side connected to a 220 ohm resistor which was connected to the GND (ground) of the bread board. The command lines needed to initiate the task are as follows:

sudo su

echo 2 > /sys/class/gpio/export

cd /sys/class/gpio/gpio2

echo out > direction


Those commands told the pi where the LED was connected on the breadboard. the code needed to turn the light on is: echo 1 > value. The code needed to turn the light off is: echo 0> value. To see where the current value is: cat value


I am next going to see whether or not it is possible to control my pi via my Macbook Pro with the El Capitan OS.

No comments:

Post a Comment