Question

void setup () Write the following code and upload it to the { Arduino, observe and comment on the pinMode (8, OUTPUT); pinMod

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

There is a input pin 2 and output pin 8.Initially the pin 8 is set to HIGH.

Initially the Arduino would read the signal from pin 2 and store that value in variable A.

If the input read from pin 2 (A) is LOW the output pin 8 is set to LOW.

If the input read from pin 2 (A) is HIGH the output pin 8 would stayed HIGH(No change in output of pin 8).

Add a comment
Know the answer?
Add Answer to:
void setup () Write the following code and upload it to the { Arduino, observe and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 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...

  • I have a program for Arduino written such that when I hold a button down, it...

    I have a program for Arduino written such that when I hold a button down, it will turn an LED off. I want to be able to print to the serial monitor how long the button was pressed for after I let go of the button. Does anybody have any ideas? Below is the code I have written thus far: Text of Code: #define LED RED_LED #define buttonPIN PUSH2 const int buttonPin = PUSH2; // the number of the pushbutton...

  • 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...

  • I am trying to program my Arduino UNO to implement a flashing pattern with two LEDs....

    I am trying to program my Arduino UNO to implement a flashing pattern with two LEDs. When one LED is off, the other must be on. The program needs to be done in assembly. I have a working program in c++ but I need to convert it to assembly. Here is my c++ program: int led = 13; int led2 = 12; void setup() {    pinMode(led, OUTPUT); pinMode(led2, OUTPUT); } void loop() { digitalWrite(led, HIGH);    delay(1000); digitalWrite(led, LOW);...

  • 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...

  • An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as...

    An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as shown, and the code shown below is uploaded. What happens? testCodeA Arduino 1.8.11 Hourly Build 2019/10/29 11:12 Arduino Uno testCodeA #define LED 13 to sv 13o 5ke & void setup() { pinMode(LED, OUTPUT); to A 10KZ Ž ŞR void loop() { int voltage-analogRead(AO); if (voltage > 1024/2) digitalWrite(LED, HIGH); else digitalWrite(LED, LOW); GND GND Done compiling Sketch uses 778 bytes (2%) of program storage...

  • An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as...

    An Arduino Uno is configured with the voltage divider connected to Analog input pin AO as shown, and the code shown below is uploaded. What happens? testCodeA Arduino 1.8.11 Hourly Build 2019/10/29 11:12 Arduino testCodeA Uno #define LED 13 to SV 130 5ks § void setup() { pinMode(LED, OUTPUT); B toap ŹR 10 Kaş void loop 1 int voltage analogRead(AO); if (voltage > 1024/2) digitalWrite(LED, HIGH); else digitalWrite(LED, LOW); HOGNO Gong Done compiling Sketch uses 778 bytes (2%) of program...

  • 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...

  • 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...

  • 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...

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