Blinking LED

Site: GoLabs
Course: Blinking LED
Book: Blinking LED
Printed by: Guest user
Date: Thursday, 25 April 2024, 2:20 AM

Description

Learn the simplest thing you can do with a GrovePi: Blink a LED.

1. Introduction

The blinking LED is the hardware version of the software world’s “Hello World” program. Once mastered, you can move on to more complicated projects like connecting a display or other sensors to the Raspberry Pi.

This example is meant to be your first project with the GrovePi. All of the parts used in this project are available in the GrovePi Starter Kit.

2. Hardware Needed

All of the hardware comes with the GrovePi starter kit. Specifically, for the Raspberry Pi LED Tutorial, you’ll need:

  1. The Raspberry Pi
  2. GrovePi
  3. Grove LED
  4. One Grove Connection wire



3. Hardware Setup

Connecting the LED to the Raspberry Pi

Connect the LED to Port D4 and power on the Raspberry Pi, using the Grove wire connector.



4. Software

Running the Program:

The example program for this project is shown below. To run the program, change directory on your Raspberry Pi to the GrovePi/Software/Python folder.

1

cd /GrovePi/Software/Python

Run the grove_led_blink.py python program:

1

sudo python grove_led_blink.py

The Grove LED will start blinking.

Source Code

The source code for the example can be found here.



5. Questions?

Have a question or a problem? Post it on the forums and we’ll help you out.