Question: Task: 1. Create a new program with a setup(), loop() and MyCallback() function. 2. Create a global variable called counter that keeps track of how


Task: 1. Create a new program with a setup(), loop() and MyCallback() function. 2. Create a global variable called counter that keeps track of how many times the MyCallback() function has been called. Make sure to edit the MyCallback() function to increment this variable. 3. Initialize the callback in setup using the MsTimer2::set and start functions. 4. Initialize the serial port in setup() and then print out the global variable you create in Step 2 from the loop() every 100 ms. You should be seeing that the counter is inching by about 100 counts every 100ms because the timer is set to be called every 1 millisecond. 7/include the library in your program #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
