Question
Please help write this program for C++ Write a C++ program for the Arduino UNO as described below. Display brief instructions on the computer screen.
Please help write this program for C++
Write a C++ program for the Arduino UNO as described below.
Display brief instructions on the computer screen.
The count should be initialized to 0 and shown on the 7-segment display and the computer screen.
When the user presses the button the count should advance and the new value should be displayed on the 7-segment display and the computer screen.
The count should be mod-10 (0 to 9 and repeat).
Use the display_digit( ) function described in the presentation for this lab.
Use the readButton( ) function provided in the presentation for this lab to allow for switch debounce.
// Global variables for readButton( ) function (see Lab #3 Lecture)
// Other global variables
void setup( )
{ // Define input and output pins
// Set up serial communication
// Display instructions on the computer screen
// Display initial value (0) on 7-segment display
// Display initial value (0) on computer screen
}
void loop( )
{ // If readButton says the button is pressed:
// Increment counter
// Adjust counter for mod-10 operation
// Display count on computer screen
// Display count on 7-segment display
}
int readButton(int buttonPin)
{ // Use code provided in Lab #3 Lecture
}
void display_digit(int N)
{ // See Lab #3 Lecture for details
}
A+5V L Button switch Circuit 1 Arduino +5V 220 Q UNO W a D3 D9 fIGIb D4 10 km D6 D7 D8 Common anode 7-segment display (see data sheet for pinout) USB serial data A+5V L Button switch Circuit 1 Arduino +5V 220 Q UNO W a D3 D9 fIGIb D4 10 km D6 D7 D8 Common anode 7-segment display (see data sheet for pinout) USB serial dataStep 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