Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started