Blinking LED

Within this tutorial we are going to make an LED blink on and off using EduBlocks and a Raspberry Pi.

Equipment You Will Need

  • 1 x LED
  • 2 x male to female jumper wires
  • 1 x breadboard
  • 1 x 330 ohm resistor
  • Raspberry Pi
  • keyboard
  • Mouse
  • SD Card with Raspbian installed
  • HDMI cable
  • Compatible Screen
  • Power Supply

The Circuit

Lets build the circuit. Make sure you have your LED the right way round. The positive leg is the longer leg on the LED, this is represented by the bent leg in the diagram below:

LED Circuit

Code

The fist thing we need to do is open EduBlocks. do this by double clicking on the EduBlocks desktop icon.(if you don’t have EduBlocks installed check out the getting started guide)

  • Click on the GPIOZero menu and click on the General menu Then locate the from gpiozero import * and drag it to the coding area.

  • Now Click on the Outputs menu menu. Then click on the LED menu From here locate the led=LED block and in the bit that is says pin type 18.

  • Next locate the led.on and click on the arrow next to on and click on blink

Your code should now look like this:
LED blink

Running Your Code

To run your code click on Run in the top far right corner.

You should now see your LED turn on.

Keep having FUN while LEARNING!