Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Created by Franck Albinet with source available here. Also presented by NSRC at APRICOT 2018.

Introduction

In this example, we will create and deploy the proverbial 1st app, “Hello, world!” to a Pycom device. Because the board does not have a display, we will use the USB connection between the board and the development PC to switch on and off an LED. In the simplest terms, a Light-Emitting Diode (LED) is a semiconductor device that emits light when an electric current is passed through it. LEDs are described as solid-state devices. The term solid-state lighting distinguishes this lighting technology from other sources that use heated filaments (incandescent and tungsten halogen lamps) or gas discharge (fluorescent lamps). Different semiconductor materials produce different colors of light.

...

Switch on the LED and select the green color. Then sleep for 5 seconds. The sleep command accepts seconds (and not milliseconds not minutes!).

Exercises

  1. Try to send Send an SOS message using the LED. The SOS is ---...--- in morse code, where a line is three times longer than a dot.

  2. Find out how short can the sleep be, while still having a blinking LED (and not a fixed one).

  3. Bonus: Can you cycle through all the colours of the rainbow?Generate random colours. Display each for one second before changing to the next.