The first pin is labelled with a minus sign, this indicates that it is the GND pin.

00:00
The middle pin is labelled with a plus sign, this indicates that it is the VCC or 5V pin.

00:00
The last pin is labelled with DIN, this indicates that it is the Digital Input pin.

00:00
First, connect the - pin on the Lorikeet to GND on the Little Bird Uno.
00:00
Then connect the + pin on the Lorikeet to 5V on the Little Bird Uno.
00:00
Lastly, connect the DIN pin on the Lorikeet to Digital Pin 9 on Little Bird Uno.
00:00
First, include the header file Adafruit_Neopixel.h. The #include here is used to include other libraries into your sketch, specifically the Adafruit_Neopixel library which we'll need in this sketch.
00:00
Now define the digital pin that is connected to DIN on the Lorikeet. In our circuit, this is digital pin 9 on the Little Bird Uno. Then define the number of LEDs attached to the Little Bird Uno. The Lorikeet has five LEDs, so this would be 5.
00:00
Next, we'll define the delay value, this is the time in milliseconds to pause between the LEDs when lighting them up later.
00:00
The next function does the initialisations required.
00:00
Add the following code in void loop. This is the code that will repeat consecutively, allowing your program to change and respond.

To understand what each line does, we have written comments in the code. Additionally, if you would like to change the colour the Lorikeet lights up, change the values in pixels.Color

Optionally, if you'd like all the LEDs to seemingly light up at once, rather than one after another, simply remove the line  delay(DELAYVAL);
00:00
Let's say you wanted to add more colours, how do you go about doing that? One way is to first define each colour as a 32-bit integer. Then use strip.Color and its RGB colour code. For example, for red the RGB colour code is (255,0,0). Next, create an array of colours, where a colour is a 32-bit integer. We can define it using uint32_t colours[].
00:00
The following code in void setup remains the same. But in void loop we are now using a for loop to set each LED colour to element 0 from the previously defined colour array. This would be red.
00:00
In the next for loop, we are iterating through the number of LEDs which is 5, but this time in the opposite direction and using the second element in the colours array. This would be blue. Upload the code to the Little Bird Uno R3 and the LEDs should now light up in red, one by one. It then lights up in blue one by one in the opposite direction!
00:00
In this final example, we've used a for loop within a for loop to iterate through the colours array. The Lorikeet now lights up each LED, one at a time in the pattern of red, green, blue, yellow, white, pink, cyan, and orange.
00:00
main.py
xxx
Terminal
screen /dev/tty.usbmodem0000000000001 115200
>>> led = Pin(25, Pin.OUT)
>>> from machine import Pin
Breadboard
Breadboard
Mark
© 2022 Chick Commerce Pty Ltd