Back to Parent

Outcome


Exercise 1

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

Show Advanced Options
Show Advanced Options

Exercise 2

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

Show Advanced Options
Show Advanced Options

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
Show Advanced Options

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.

The first try was wrong but beautiful. 

I put the "strip.show()" in the void loop, so the new pixel changed color when the previous pixel remain the old color.

Show Advanced Options
Show Advanced Options

I moved strip.show(); out of the void loop.

Now after every pixel get the new color information, the Neopixel LED will display the color as a whole.

Show Advanced Options
Show Advanced Options

Simple Ambient Orb

We’ll create a simple version of the ambient orb first. It will work as follows:

  1. You’ll set up IFTTT and connect it to your Google Calendar.
  2. You’ll create a Particle function in your code.
  3. You’ll connect the two so that 15 minutes before a meeting on your calendar, IFTTT will call your Particle function.
  4. Over the 15 minutes between the Particle function being called, and the start of the meeting, program your Neopixel to slowly fade to red.
  5. For 15 minutes after your meeting was due to start have it slowly fade back to white (the inverse of step 5)

At first, I let redPercentage subtracts 50 every time, but in the last loop, the redPercentage will go below 0, which causes errors in LED display.   So I realized I need to set up some number that can divisible by 225.

Show Advanced Options

I changed the number from 50 to 2.5, and added a new cloud function "Red" to turn on the light. It took a long time to figure out how to connect to ifttt platform. I changed the function command from string to number because I don't why string don't work.

int TurnOn(String command){

if(command==TurnOn){

}


int setRed(String command){

int number = atoi(command);

if(number ==1){

red = number;

}

return red;

}

Show Advanced Options

With the help of the Jaki, The code finally worked! After the ifttt platform gives the signal, it turns from white to red, and then turns from red to white.

Show Advanced Options
Show Advanced Options

Reflection

1. Check the number carefully, sometimes 255.0 doesn't equal 255.

2. Don't set too many if conditions, because it is hard for understanding.

Drop files here or click to select

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