Question
(((this should be working for an arduino))) (((this should be working for an arduino))) For this part, you will write a source file that experimentally
(((this should be working for an arduino)))
(((this should be working for an arduino)))
For this part, you will write a source file that experimentally tests the efficiency of math- ematical operations when using different variable types. To do this, create a volatile int variable initialized to some nonzero value and, in a loop, multiply the variable by 2 a total of 1000 times. Use the serial monitor to display the amount of time in microseconds that the loop took to execute (side note: the purpose of using the volatile keyword is to prevent the compiler from optimizing out the loop altogether. In general, the optimizer looks for sections of code that it deems unimportant to the application, and removes them. Try it without volatile, and see what happens). Redo the experiment using a volatile float variable type and record the difference in time between the two experiments. Com- ment on the significance of the results. How does this relate to the architecture of the ATmega328P?
(((this should be working for an arduino)))
(((this should be working for an arduino)))
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