Raspberry Pi LED Flasher using C program

In: Project Code: PL000008
Share

In this project you will learn how to access GPIO pins of raspberry pi and turn the led on and off(flash) using a C program.

project diagram

Project Steps


Required components


Along with your Raspberry Pi, you will need the following components for this project:

Raspberry Pi GPIO Information


GPIO stands for general-purpose input/output. You will find 40-pins for all current Raspberry Pi boards. Any of the GPIO pins can be configured by the application programmer in software as an input or output pin and used for a wide range of purposes.

The pin diagram of Raspberry Pi board is shown in the following picture.

course thumb
Pin diagram of Raspberry Pi.

Project Schematic diagram


The schematic diagram for this project is shown in the following picture.

course thumb
Project schematic diagram.

Make sure that PI is NOT powered on. You should connect the GPIO 17(pin 11) to one end of the resistor. The other end of the resistor should be connected to the +ve end of the led. The led has two leads. The short lead is having -ve polarity and the long lead is having the +ve polarity. The -ve end of the led should be connected to GND pin on the Raspberry Pi which is pin 9. Once you make all your connections your setup should look like the following. Once you made all your connections, then power on the Raspberry Pi.

course thumb
Project setup diagram.

Prepare program, compilation, output


To Read Full Article

Login or Register to create a free Mbed Technologies account

Register Login

Looking for a new project? Write and upload your project information .
Share

Articles


C Programming

More Articles Categories

Technical articles

Prepare for software jobs


Test your skills