Reflection
Third Milestone
Second Milestone
My second milestone was coding everything on particle, so that the information from IFTTT gets sent to the photon and make the neopixel light up based on the weather. Another thing I did was create an applet on IFTTT so that the code can take in certain conditions. For the code, I coded everything on particle since the hardware I used was the particle photon.
Library, Defining and Variables: I first uploaded files from the particle library which are precoded files for whatever you need. Since my project uses a neopixel, I uploaded the neopixel file. For all projects that require you to use the library files, application.h is needed since this code allows you to import files from the library and function. SYSTEM_MODE(AUTOMATIC), makes the photon into an automatic mode so that it will try to connect to Wi-Fi automatically. After that, I defined all the colors by assigning each color a specific brightness. For example, for my PEACH color, I made the brightness 200 for the red LED, 50 for the green LED and 5 for the blue LED. This makes sense since the peach color is most similar to red. Just like I defined all the colors, I also defined the information of the pixels, which are the pin, the number of pixels and the type. That way, I can assign values to the neopixel to use it later in my code. “knop” is an int variable I created I which is connected to the D2 and D3 pins on the photon. I also created variables called var_knop and weather and set those values equal to 0. I created those variables early in the code, but used it later.
Void Setup: Next, I have my void setup, where I wrote code for information that only needs to be run or put into the system once before it goes into the loop. Since it’s a void, it doesn’t return a value. In my void setup, I have a code that says, pinMode, which makes a pin to behave as an input or an output. In this case, the digital pins are used as INUT_PULLDOWN, which means that the input pin will be LOW when the switch is open and HIGH when the switch is closed. This concept is also used later in the code where I have digitalRead written. After that, I have the particle.function, which allows the code to be run when it’s requested from the cloud, in this case, from weather underground. Below that, I also created a particle variable, which is a way to debug the system. I used this because I didn’t quite know what the IFTTT was returning as a condition, so I typed this in to find out on the particle website, that way, I can set my command variable in my method. Finally, the strip.begin(); prepares data pin for the neopixel output and strip.show(); makes all the pixels to be ‘off’.
Void Loop: The void loop is a loop, meaning that it will keep running the code over and over again until it reaches a certain value or when it tells itself to stop. Again, since it’s a void, it doesn’t return a value. In my void loop, there are two parts. The first part is where I make the buttons function and the second part is where I have the color changing based on the weather.
Setting my Applet: Another thing I had to do for my project was to set up my applet on IFTTT. Since this was a weather indicator, I chose the weather underground service and for my trigger, I chose “Today’s weather report”. I originally chose a trigger called “Current condition changes to”, but I realized that for that certain trigger, it will only tells the code to change color only when the weather changes. Since that is not what I wanted, I chose the “Today’s weather report” for my trigger. In the trigger, I set the location and the time, so that my neopixel will light up based on when and where I wanted. Then, for my action service, I chose the particle, so that the particle will take in information from IFTTT and make the neopixel change color based on the information from the weather underground.
Overall: Overall, this part of my milestone was successful since I had a little bit of coding background from taking an intro to computer science course at my school. I was able to make many different modifications in my code of which colors I wanted the neopixel to light up, as well as how I wanted it to light up. For some conditions, I made the light to flash, while for others, I made it so that it changes between two colors every 30 seconds or so. I was also able to have a certain pixel to light up in one color, while others in other colors. For example, I made it so when the weather is a thunderstorm, it will light up in a rainbow color, making every pixel to have a different color. I was very happy with the fact that coding on particle was very similar to java and I was able to understand mostly everything without research. It was also very cool to learn about specific functions for particle like particle.function and digitalRead. I also didn’t know about particle libraries, so learning about that was also very interesting.
First Milestone
Simon Says
STEM Summer Camps Coding & Robotics Classes For Kids San Francisco Coding & Robotics Classes For Kids New York Coding & Robotics Classes For Kids Denver Coding & Robotics Classes For Kids Palo Alto STEM Summer Camps For Kids in New York STEM Summer Camps For Kids in Palo Alto STEM Summer Camps For Kids San Francisco STEM Classes For Kids in New York STEM Classes For Kids in Palo Alto STEM Classes For Kids in San Francisco Code Classes For Kids Code Classes For Kids in New York Code Classes For Kids in Palo Alto Code Classes For Kids in San Francisco STEM Summer Camps For KidsSTEM Summer Camps Coding & Robotics Classes For Kids San Francisco Coding & Robotics Classes For Kids New York Coding & Robotics Classes For Kids Denver Coding & Robotics Classes For Kids Palo Alto STEM Summer Camps For Kids in New York STEM Summer Camps For Kids in Palo Alto STEM Summer Camps For Kids San Francisco STEM Classes For Kids in New York STEM Classes For Kids in Palo Alto STEM Classes For Kids in San Francisco Code Classes For Kids Code Classes For Kids in New York Code Classes For Kids in Palo Alto Code Classes For Kids in San Francisco STEM Summer Camps For Kids