Back to Parent

Outcome


Outcome

By going through these exercises, I was able to learn the basics of creating a program and connecting it to the Particle dashboard so it can receive instructions from the internet.

First Sketch:

Exercise 1

Modify the program to Blink on and off every 3 seconds.

Exercise 2

Change the program to blink on and off 5 times then stop for 3 seconds. Each blink should be 0.5s (a half second)

Exercise 3

Go back to the original program. Now add a second LED to the circuit.

Program the LED’s to alternate blinks i.e. when LED 1 turns on, LED 2 turns off, then when LED 2 turns on, LED 1 turns off.

Show Advanced Options
Show Advanced Options
Show Advanced Options
Show Advanced Options

Making a Connected LED


Exercise 1:

Modify the cloud function to blink the LED 3 times after it is called


Exercise 2:

Modify the cloud function as follows:

Instead of passing a HIGH Or LOW string pass the number of times you would like it to blink
Set the function to blink that number of times
Finally once it has completed all of the blinking it should turn the LED off


Exercise 3:

Go back to the original program. Now add a second LED to the circuit.

Change the program and cloud function to allow you to control both LEDs remotely

Show Advanced Options
Show Advanced Options
Show Advanced Options
Show Advanced Options

Process 

If appropriate, if you ran into difficulties and/or if you experimented (went beyond the materials), describe how you arrived at the outcome. Outline the process you underwent to reach the outcome (experiments, hacks, tests, refinements, iterations, failures)

One difficulty I ran into was trying to execute a for loop inside of an if statement's actions in a function being defined. As such, I ended up hard coding the number of flashes required for some pieces. Eventually I was able to figure it out and solve that issue by moving the for loop outside of the if statement. 

Something I experimented with was the timing of LED on and LED off times to make blinks look more clustered together instead of having uniform on/off times. Personally, I prefer the result because it allows me to more easily understand when the LED is taking a break between clustered blinking.

I also took the liberty of making both LED's callable for a certain number of blinks for the final exercise instead of using the original program exactly because it seemed more intuitive for the user to input the number of blinks rather than having the program break if someone did not enter HIGH or LOW.

Reflection

In this project I learned to be conscious of my syntax, make sure I have things wired correctly, and learned to experiment with my code a bit to find new results. Overall, I found that the coding portion was quite similar to the C++ that I have used before, so it was not overly challenging. The wiring required a bit of thought, but once I had everything logically organized, it also became relatively easy.

If I were to do something differently, I would waste less time reading and more time tinkering with the code. I feel that I learn better with a more hands-on and experimental touch. In addition, I would have coded the final program to work in a couple more ways such that either LED could be called and set to stay on HIGH, LOW, or be asked to blink a number of times. It would have made the little app a bit more fun and intuitive to engage with.

Drop files here or click to select

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