Question: Write a program for the Arduino board to ask the user to enter a number between 0 and 9 and then display the digit on


Write a program for the Arduino board to ask the user to enter a number between 0 and 9 and then display the digit on a numeric seven segment display. You will need to reference the Serial functions Serial.available(), Serial.read(), and possibly Serial.flush() from the Arduino website.

Use a 2-dimensional array in your program. The first dimension (rows) indicates the numeric value (0-9) and the second dimension (columns) indicates the logic values to light the individuals LEDs to display the corresponding number.

The program should ask the user to enter a number between 0 and 9 using the serial monitor. (Hint: Use serial.available() to wait until some input is available.) The program should then set the appropriate logic values from the array to the digital pins to show the digit on the seven segment displaky. The display is a common anode type. This means that a logic LOW (0) will turn an LED on, while a logic HIGH (1) will turn an LED off.




Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!