Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I just need help with as much as possible with the C arduino program. anything helps You are to create a new application that will
I just need help with as much as possible with the C arduino program. anything helps
You are to create a new application that will execute on your Arduino platform. Your application will repeatedly convert an analog voltage connected to analog pin A0 to its corresponding digital value. Your code is required to perform the conversion using the analogRead function, and the time required for each conversion and the resulting digital value from the conversion must be displayed to the screen using the serial monitor. The analog signal to be converted is a voltage from 0 to +5V that is adjustable via the potentiometer. Be careful with analog values> 5.0 V as they can damage the ADC Upon power up or reset, your code will start by displaying a reset message. Then, it will display a prompt to the screen asking the user for a c, to start a set of conversions. When the user enters a 'c', your program should display a message to the screen that a series of 30 measurements is about to begin. Your cod should then convert the analog input 30 times (make sure you are waiting long enough between conversions). For each conversion, your code should display the number of the conversion, the resulting digital value (in hexadecimal), and the required conversion time. After the 30th conversion is complete, the average time required for the 30 conversions should be displayed and the program should prompt the user to begin another set of conversions, t ( ) on IS wn.d , The only valid user input at the prompt is 'c'. All other user inputs are considered erroneous and should be accounted for appropriately. All user inputs entered during a set of conversions should be ignored. All user inputs (valid and invalid) should reset the watchdog timer. If the user does not provide any inputs within 4 seconds, the watchdog timer should expire and the board should reset. The timeout period should begin upon prompt to the user for input Sample program output: Board was reset Enter 'c, to start a set of conversions > (user enters Starting a set of conversions: #1: digital value-3FF #2: digital value = 3A0 Time = 118usecs Time = 120 usecs all user inputs during conversions are ignored) #30: digital value = 000 Time = 120 usecs avg conversion time = 120.00 usecs Enter c' to start a set of conversions > (user enters x) Error: invalid user input - the only valid user input is 'c' enter c' to start a set of conversions > (user enters nothing for > 4 seconds) oard was reset You are to create a new application that will execute on your Arduino platform. Your application will repeatedly convert an analog voltage connected to analog pin A0 to its corresponding digital value. Your code is required to perform the conversion using the analogRead function, and the time required for each conversion and the resulting digital value from the conversion must be displayed to the screen using the serial monitor. The analog signal to be converted is a voltage from 0 to +5V that is adjustable via the potentiometer. Be careful with analog values> 5.0 V as they can damage the ADC Upon power up or reset, your code will start by displaying a reset message. Then, it will display a prompt to the screen asking the user for a c, to start a set of conversions. When the user enters a 'c', your program should display a message to the screen that a series of 30 measurements is about to begin. Your cod should then convert the analog input 30 times (make sure you are waiting long enough between conversions). For each conversion, your code should display the number of the conversion, the resulting digital value (in hexadecimal), and the required conversion time. After the 30th conversion is complete, the average time required for the 30 conversions should be displayed and the program should prompt the user to begin another set of conversions, t ( ) on IS wn.d , The only valid user input at the prompt is 'c'. All other user inputs are considered erroneous and should be accounted for appropriately. All user inputs entered during a set of conversions should be ignored. All user inputs (valid and invalid) should reset the watchdog timer. If the user does not provide any inputs within 4 seconds, the watchdog timer should expire and the board should reset. The timeout period should begin upon prompt to the user for input Sample program output: Board was reset Enter 'c, to start a set of conversions > (user enters Starting a set of conversions: #1: digital value-3FF #2: digital value = 3A0 Time = 118usecs Time = 120 usecs all user inputs during conversions are ignored) #30: digital value = 000 Time = 120 usecs avg conversion time = 120.00 usecs Enter c' to start a set of conversions > (user enters x) Error: invalid user input - the only valid user input is 'c' enter c' to start a set of conversions > (user enters nothing for > 4 seconds) oard was resetStep 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