Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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 data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions