Skills Dev III - Akshay Soma

Made by Akshay Soma · UNLISTED (SHOWN IN POOLS)

Build an LED notification for upcoming calendar event

Created: December 4th, 2021



    • I created a light notification that fades from white to red over the 15 minutes before a meeting is going to start and back to white during the first 15 minutes of the meeting, as triggered by IFTTT
            • I put a tissue over the light because it was so bright and the code used in the video below fades in/out much quicker than the final code provided, for example purposes.

Skills Dev 3 Video
Akshay -
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>

#define PIXEL_PIN D2
#define PIXEL_COUNT 16
#define PIXEL_TYPE WS2812
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

long startTime = 0;
long endTime = 0;
long preTime = 0;
int event(String trigger);

//for light color iteration
int x = 255;

void setup() {
Particle.function("event", event);

void loop() {

    if(millis() < startTime){
        for(int i = 0; i<16; i++){
         uint32_t c = strip.Color(255, x, x);   
         strip.setPixelColor(i, c);
     if(millis() > startTime && millis() < endTime){
        for(int i = 0; i<16; i++){
         uint32_t c = strip.Color(255, x, x);   
         strip.setPixelColor(i, c);
    if(endTime > 0 && millis() > endTime){
        preTime = 0;
        startTime = 0;
        endTime = 0;

int event(String trigger){

preTime = millis();
startTime = preTime + 900000;
endTime = startTime + 900000;

return 1;
Click to Expand


Describe the process you underwent to reach the outcome (problems encountered, how you resolved them, as well as, experiments, hacks, tests, refinments, iterations, failures)

I started the process by working through the guides to get the Neopixel to light up and learning how to manipulate the code to create interesting results. Next I signed up for IFTTT and got it setup to call the function for my code 15 minutes before an event started.

Finally, I started the first design of this project. I coded everything to work using the delay() command. There was no use of the loop section in the code. While that worked well, we discussed in class how this made the code difficult to interrupt for testing, so I went back to improve the design. I used the millis() command within the loop section, global variables, and multiple if statements to create something that was easier to test.



Reflect on the process of making this project. What did you learn? What would you do differently?

In my first implementation of the project, I learned how to call a function using IFTTT and write the code to fade from white to red and back. This helped me learn more about how the code executes and where to place a delay to manipulate if colors change across the ring together or if each pixel moves independently. 

Moving from there, I learned how to use millis() to create better functioning code. It also taught me how I can compartmentalize pieces of a task into various sections using functions and if statements. If I were to do this differently, I would consider changing each pixel independently to make the transition from one color to the next even smoother. 

Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.



Build an LED notification for upcoming calendar event