web_blocek_neopixel

IDC Neopixel Modules

The Neopixel module is a smart solution for creating lighting effects and color animations using eight RGB LEDs controlled by a micro:bit. It allows for easy connection and immediate programming in the MakeCode environment. Create your own light animations, signaling systems or color indicators while learning the basics of programming and working with electronics in a fun way.

Description

Neopixel contains 8 RGB LEDs that can be individually controlled and display any color using a combination of red, green, and blue components. It is suitable for visual indication, lighting effects, and teaching color mixing. Thanks to the IDC connector, you can easily connect it to the micro:bit via a universal fixture.

Specifications

  • Connector: IDC
  • Exit: logical (digital color management)
  • Dimensions: 30 × 30 × 13 mm
  • Number of LEDs: 8 RGB (programmable)

Connection

To connect the module to the universal fixture, we will use a wire with a six-pin IDC connector. First, connect the flat six-core wire with an IDC connector to the universal fixture at position 1 and then connect the other side to the module. The IDC connector has a groove on one side, so it can only be connected in one direction.

Program

Basic program

This program displays a rainbow on the Neopixel, with the colors rotating continuously. The visual effect is created by constantly repeating the rotation of the colors, which makes the LEDs create the impression of a moving light strip.

The program uses the Neopixel library, where the "SET" block sets the strip variable, which determines the number of LEDs (in our case 8) and the connection pin (pin 14). The strip show block turns on the display and activates the rainbow effect. By repeating the rotation in a loop, a smooth and constant movement of colors around the circle is achieved.

Tasks

Task 1: Traffic light

Program the Neopixel to simulate a traffic light. Let the colors red, orange, and green light up one after the other. Don't forget to add time delays so that each color stays on long enough.

Task 2: Police

Split the Neopixel into two halves - set one to blue, the other to red. Program it to alternate colors to simulate a flashing police beacon.

Task 3: Mood

Assign different colors to different moods (e.g. blue = calm, red = angry, green = happy). Use the program to display the current mood on the Neopixel of your choice.

Task 4: Temperature indicator

Connect Neopixel to a temperature sensor. Change the color based on the current temperature – for example, blue for cold, green for comfortable temperature, and red for hot.

Task 5: Points counter

Use Neopixel as a visual counter - each time you press a button, another LED lights up. This way you can keep track of the number of points you have earned, for example in a game or quiz.