Back to Parent

Outcome


Controlling Outputs: Neopixels

For this Skills Dev, we created an ambient calendar alert using a neopixel strip. To understand how to do this, I first went through the Neopixel tutorial on the Lab site.

Programming Neopixels

Following the setup guide on the Lab site, I was able to connect the Neopixel strip and turn on all of the pixels at once.

Img 5767.thumb
Show Advanced Options
Show Advanced Options

Programming Neopixels: Exercise 1

Modify the code to light up pixel by pixel then reverse the sequence turning each pixel off one by one

Img 5765.thumb
Show Advanced Options
Show Advanced Options

Programming Neopixels: Exercise 2

Modify the code to light up blue, then red, then green then white in sequence

Show Advanced Options

Programming Neopixels: Exercise 3

Change the code to only light up only one pixel at a time. With each loop move that pixel one position higher. When it reaches the final pixel, restart the sequence at zero i.e. build a single pixel that will continually cycle

Show Advanced Options

Programming Neopixels: Exercise 4

Add three Particle.function to set the Red, Green and Blue components. Allow these values to be set from 0-255 and as they are set to change all of the pixels on the LED strip to that color.

Show Advanced Options

Practice Exercise: Ambient Calendar Alert

This exercise asks us to create an ambient calendar alert using a neopixel strip. It is connected to Google Calendar through IFTTT and is able to send an alert to a device 15 minutes before an appointment. The neopixels will respond by fading up slowly to signal there’s an event, and changing color as the event approaches. Ultimately it will then fade out after the event has begun. The process is outlined in steps below:

Step 1:

Program your Neopixel Ring to display a cool white by default.

Img 5780.thumb
Show Advanced Options
Show Advanced Options

Step 2:

Add a Particle Cloud function and use it to change the color to red immediately. Test this with the Particle Console. 

Show Advanced Options

Step 3:

Program your Neopixel to fade to red over 1 minute using millis(). Starting with a much faster transition will help you quickly test, iterate and debug it.

Img 5782.thumb
Show Advanced Options
Show Advanced Options

Step 4:

After the initial transition, now program your Neopixel to fade from red back to white over 1 minute using millis()

Show Advanced Options

Step 5:

With those working as quick transitions, test them working over 15 minutes

Show Advanced Options

Step 6:

Finally and once you’re happy with the behavior, hook it up to IFTTT.

Reflection & Next Steps

I really enjoyed this Skills Dev, and it provided a nice opportunity to test out what I've learned so far about for loops, millis(), Neopixels, and the Particle Cloud functions and Console app. It was also extremely helpful to follow the Lab site's suggestion of breaking the practice exercise in small steps, rather than jumping straight into IFTTT. This is a method I will definitely implement with future projects.

Next, I will be moving onto Skills Dev 4!

Drop files here or click to select

You can upload files of up to 20MB using this form.