Question: 3. Below are two programs intended to toggle the red LED. Describe which is correct and why. void toggleLight() void toggleLight() uint8_t lightState = 0;

 3. Below are two programs intended to toggle the red LED.

3. Below are two programs intended to toggle the red LED. Describe which is correct and why. void toggleLight() void toggleLight() uint8_t lightState = 0; light State = !light State; digitalWrite (RED LED, lightState); static uint8 t lightState = 0; light State = !light State; digitalWrite (RED_LED, lightState); void setup() { // put your setup code here, to run once : pinMode(RED_LED, OUTPUT); void setup() { // put your setup code here, to run once : pinMode(RED_LED, OUTPUT); void loop() { // put your main code here, to run repeatedly: toggleLight(); delay(500); void loop() { // put your main code here, to run repeatedly: toggleLight(); delay(500); 4. What happens when a recursive function does not have a proper exit condition? 5. Write a function that prints the last digit of a decimal number as a word using Serial.println(). For example, if the function were passed the argument 2357, it would print Seven. a. Hint: For my implementation the function prototype was: void printDigit(int number)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!