GPIO Programming:
Blinking LED


Computing Machinery II Tutorial:
Week of March 18th
Review
- cross compiled UART program
- Cable issue
- UART motivation
- Pi's GPIO Pins
Assignment 3

Today:
- Breakout board to breadboard
- LEDs on breadboard
- Blinking LED programming
- Look at my mine work
Breadboard
- aka proto board

to light up an LED
3.3V into long end
other end to ground (GND)
\{

GND Pin
GPIO Pin
Components
- jumper cable
- LED
- resistor
- pushbutton
- conductive wire

You will use this exact setup for your next assignment
GPIO C Programming
- lets just use gpio.h in C
- why do it in ARM Assembly?
- we read and write to specific memory addresses to control the Pi's GPIO pin voltages
- GPFSEL[0-5]
- $$3 \times 53 = 159 < 192 = 32 \times 6$$
- GPSET[0,1]
- GPCLR[0,1]
- $$ 53 < 64 = 32 \times 2$$
- GPFSEL[0-5]


GPIO Blinking LED
- look at code
- hard coded pin numbers
- main function
- support functions

GPIO Blinking LED
- Modify program
- make it go twice as fast
- add a second LED
- add a third?
Pi_2
By pathomas
Pi_2
- 406