Back to Parent

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.

I am only showing one code chunk and video here because the code of Exercise can be used to achieve the outcome in Exercise 1. 

The way I convert the String command input to an integer variable is using atoi() function, from the C string library. Later on, I notice that I can use the attribute .toInt().

I added one section to return -1 if the command input is less than zero. It indicates the program encounters an error and the error code is -1.


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0