Question

7 Segment Pin Arduino Pin 2 3 4 Connection 7 (A) 6 (B) 4 (C) 2 (D) 1 (E) 9 (F) 10 (G) 5 (DP) 6 7 8 9

--------------------------------------------------------------------------------------------------------------------------------------------

this is the code please add the missing parts (edit it)

// Longer, more obvious example for Arduino 7 segment display
// http://www.hacktronics.com/Tutorials/arduino-and-7-segment-led.html
// License: http://www.opensource.org/licenses/mit-license.php (Go crazy)

void setup() {
              
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(9, 0); // start with the "dot" off

}


void loop() {


{

// write '9'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 0);
digitalWrite(6, 0);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);
}

{
// write '8'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 1);
digitalWrite(6, 1);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);
}


{

// write '7'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 0);
digitalWrite(6, 0);
digitalWrite(7, 0);
digitalWrite(8, 0);
delay(1000);
}


{
// write '6'
digitalWrite(2, 1);
digitalWrite(3, 0);
digitalWrite(4, 1);
digitalWrite(5, 1);
digitalWrite(6, 1);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);
}


{
// write '5'
digitalWrite(2, 1);
digitalWrite(3, 0);
digitalWrite(4, 1);
digitalWrite(5, 1);
digitalWrite(6, 0);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);
}

{

// write '4'
digitalWrite(2, 0);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 0);
digitalWrite(6, 0);
digitalWrite(7, 1);
digitalWrite(8, 1);
delay(1000);

{
// write '3'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 1);
digitalWrite(6, 0);
digitalWrite(7, 0);
digitalWrite(8, 1);
delay(1000);
}

{

// write '2'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 0);
digitalWrite(5, 1);
digitalWrite(6, 1);
digitalWrite(7, 0);
digitalWrite(8, 1);
delay(1000);
}

{
// write '1'
digitalWrite(2, 0);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 0);
digitalWrite(6, 0);
digitalWrite(7, 0);
digitalWrite(8, 0);
delay(1000);
}

{
// write '0'
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 1);
digitalWrite(6, 1);
digitalWrite(7, 1);
digitalWrite(8, 0);
delay(1000);
}
}}

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
-------------------------------------------------------------------------------------------------------------------------------------------- this is the code please add the missing parts (edit it) // Longer, more obvious...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Program is for an Arduino 1. Add the letters “A”, “b”, “c”, “d”, “E”, “F” to...

    Program is for an Arduino 1. Add the letters “A”, “b”, “c”, “d”, “E”, “F” to your homework program. Continually display “0123”, “4567”, “89Ab”, “cdEF” with a one second delay between each one. HINT: Expand pickNumber() to use numbers 10-15 (a-f in hex). Create new functions for a-f. (THIS IS THE CODE FROM THE HOMEWORK) /*************************************** name:Stopwatch function: you can see the number increases by one per second on the 4-digit 7-segment display. ***********************************/ //Email:[email protected] //Website:www.sunfounder.com /**************************************/ #include //the pins...

  • Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used...

    Assume the following script is uploaded to an Arduino UNO and a digital multimeter is used to measure the voltage between Arduino pin 12 (red probe or +) and pin 13 (black probe or -). void setup) pinMode(13, OUTPUT); pinMode(12, OUTPUT); } void loop(){ digitalWrite(13, HIGH); digitalWrite(12, LOW); delay(500); digitalWrite(13, HIGH); digitalWrite(12, HIGH); delay(500); } Select one: о a. -5 Volts, 500 second delay, 0 volts, 500 second delay, repeat second delay, 0 volts, V2 second delay, repeat о b....

  • void setup () Write the following code and upload it to the { Arduino, observe and...

    void setup () Write the following code and upload it to the { Arduino, observe and comment on the pinMode (8, OUTPUT); pinMode (2, INPUT); digitalWrite (8, HIGH); function of the circuit and explain how the code is working. In addition, explain how to turn ON the LED in case it is OFF. void loop () { digitalRead (2) int A if (A 0) { digitalWrite (8, LOW); void setup () Write the following code and upload it to the...

  • Mechatronics void setup () Write the following code and upload it to the { Arduino, observe...

    Mechatronics void setup () Write the following code and upload it to the { Arduino, observe and comment on the pinMode (8, OUTPUT) function of the circuit and explain how the pinMode (2, INPUT); code is working. In addition, explain how to digitalWrite (8, HIGH) turn ON the LED in case it is OFF. void loop () { digitalRead (2) int A if (A 0) { digitalWrite (8, LOW) void setup () Write the following code and upload it to...

  • 14. 10 pts. You have the following code lines in an Arduino c++ sketch to blink an LED and control a standard servo (not a continuous servo) and buzzer: #include <Servo.h> Servo frontSer...

    14. 10 pts. You have the following code lines in an Arduino c++ sketch to blink an LED and control a standard servo (not a continuous servo) and buzzer: #include <Servo.h> Servo frontServo; int time 2500; int multiple 3; int leg-5 int red 2; void setup()X pinMode(red,OUTPUT) frontServo.attach(leg): pinMode(4, OUTPUT) void looplf frontServo.write(0); digitalWrite(red, HIGH); delay(time); tone(4,400,500); digitalWrite(red,LOW); time-time"multiple; delay(time); Answer the following: What pin should the LED be connected to? what pin should the information lead wire of the...

  • Please explain to me how the following arduino code control the smart home system design below. #...

    Please explain to me how the following arduino code control the smart home system design below. #include "ESP8266.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <dht.h> #define DATA_PIN 2 #define SSID       "abc" #define PASSWORD   "12345678" byte termometerLogo[8] = {     B00100,     B01010,     B01010,     B01110,     B01110,     B11111,     B11111,     B01110 }; byte humidityLogo[8] = {     B00100,     B00100,     B01010,     B01010,     B10001,     B10001,     B10001,     B01110, }; SoftwareSerial mySerial(10,11); ESP8266 wifi(mySerial); LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); dht DHT; char buffData[150]; const int...

  • In the code below i am using a LS-3006 SERVO on the arduino uno and everytime...

    In the code below i am using a LS-3006 SERVO on the arduino uno and everytime i hit the pushbutton to input a time the servo comes on. Would anyone be able to tell me what a solution is to this problem? Thanks #include <Wire.h> #include <DS3231.h> #include <Servo.h> #include <LiquidCrystal.h> #include <Keypad.h> const byte ROWS = 4; // # of rows const byte COLS = 4; // # of columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3','A'},...

  • This question is about the Arduino code. Please complete a 4-input circuit on your Arduino. Your...

    This question is about the Arduino code. Please complete a 4-input circuit on your Arduino. Your circuit, in addition to cycling through a binary representation of the numbers 0-15 using LEDs, should use the Serial port to output the decimal equivalent of each of the numbers in the format: Output: 15 ... if the value was 1111, and so forth. You will be asked to upload your code as well as a photo of your working breadboard circuit. Add comments...

  • I'm trying to make a circuit from this code that I found for a personal project,...

    I'm trying to make a circuit from this code that I found for a personal project, but I'm having trouble figuring it out. Could someone make me a Circuit Diagram for this code with an LED, Servo, and Arduino Nano on BreadBoard. (No Battery, just use usb power from Nano) Thank You. Nano Code: const int servoPin = 5; const int buttonPin = 3; const int LEDPin = 4; #include <Servo.h> Servo visorServo; void setup() { visorServo.write(0); // Initial position...

  • Design a circuit and Arduino program that accomplishes the following: An IR distance sensor will detect the presence (t...

    Design a circuit and Arduino program that accomplishes the following: An IR distance sensor will detect the presence (through waving of a hand) A H-Bridge circuit with 9V battery power will control the direction of the DC motor as described in Chapter 4 (pp. 70-79) of your textbook. When a hand is waved over the IR sensor, the motor moves in one direction (simulating opening a door). There is a 2 second pause, and then the motor moves in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT