Question

In: Electrical Engineering

what is the following (ARDUINO): -The digitalRead function -The correct setup for the “for” / “for...

what is the following (ARDUINO):

-The digitalRead function

-The correct setup for the “for” / “for next loop” control:

- The analogWrite function can be used to

-Serial.print() will display information on

Solutions

Expert Solution

  • digitalRead(pin) reads the value from a specified digital pin (argument of the function) and returns either a HIGH or LOW. If the mentioned pin is not connected to anything the value returned by the function is not reliable - can be HIGH or LOW randomly.
  • For loop does not require any setup. The syntax for the function is as follows:

for(initialization; condition; increment)

{ // statements; }

'for next' loop is present as part of visual basic and not in Arduino.

  • analogWrite(pin, value) writes an analog value to the specified pin (which should be of integer data type). The parameter value specifies the duty cycle and can take integer values between 0 (always OFF) and 255 (always ON). It does not return any value and when it is called it generates a steady square wave of the specified duty cycle on the specified pin until other read/write functions on the same pin are called.
  • Serial.print(val, format) will give data (in the parameter val) to the serial port and thus, the device connected to the corresponding serial port will display the data. The second parameter of the function is optional and specifies the format of the data to be passed to the serial port.

Related Solutions

What would be the wiring setup and coding using an Arduino for a display of the...
What would be the wiring setup and coding using an Arduino for a display of the temperature of the room it is in?
what is the following (ARDUINO): -Examples of a standard Arduino library -The Arduino uses a structured...
what is the following (ARDUINO): -Examples of a standard Arduino library -The Arduino uses a structured programming language-what type -Channels of A/D conversion on the Arduino Uno -The Arduino correlates temperature readings with what
ARDUINO Create a function that will ask the user to enter the values for each of...
ARDUINO Create a function that will ask the user to enter the values for each of the three colors (red, green and blue) between 0 and 255. The function should check that the user does not enter a number bigger than 255 or smaller than 0. If this happens, the function should keep asking for a valid number.
what is the following (ARDUINO): -Analog pins can be used to -AnalogReadSerial: -What pins on the...
what is the following (ARDUINO): -Analog pins can be used to -AnalogReadSerial: -What pins on the Arduino can be assigned as… -The Arduino uses what to assign analog values?
Explain the section of code in the setup() function that implements the following instructions Wire.beginTransmission(0x68); Wire.write(0);             ...
Explain the section of code in the setup() function that implements the following instructions Wire.beginTransmission(0x68); Wire.write(0);              // set the address byte sec = Wire.read(); Wire.endTransmission();     // stop transmitting Wire.beginTransmission(0x68); Wire.write(0);              // set the address Wire.write(sec & 0x7F);     // clear CH bit Wire.endTransmission();     // stop transmitting Why is this necessary?
Pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board b... pharaphrase and...
Pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board b... pharaphrase and rewrite the following paragraph: Arduino Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to...
witches »   HW-20: Arduino - Motor Speed.problem Arduino - Measuring Motor Speed Arduino sketch with...
witches »   HW-20: Arduino - Motor Speed.problem Arduino - Measuring Motor Speed Arduino sketch with corresponding line numbers per coding line. Match line # 1 through #17 with the corresponding instruction purpose. _____________________________________________________________________ 1.   int count = 0;      float f = 0;      float PPR = 500;      float RPM= 0; 2.   void setup() 3.      pinMode(2,INPUT); 4.      attachInterrupt(0,freq,RISING); 5.      Serial.begin(9600); 6.    void loop()       { 7.      count=0; 8.      delay(100); 9.      f=10*count; 10.    RPM=f/PPR; 11.    Serial.print(count); 12.    Serial.print(" Pulses/100ms");...
Multiple Choice/ Arduino Review -The Arduino uses what to assign analog values? a. Sine waves b....
Multiple Choice/ Arduino Review -The Arduino uses what to assign analog values? a. Sine waves b. PWM c. Square Waves d. Both b and c - Which Of the following is NOT an example Of a standard Arduino library? a. Servo b. TFT c. LiquidCrystal d. Thermo - The Arduino language is based on what? a. Python b. Java c. C/C++ d. HTML - How many channels of A/D conversion does the Arduino Uno have? a. 6 b. 13 c....
Which of the following statements regarding uterine function is NOT correct? The cervical region of the...
Which of the following statements regarding uterine function is NOT correct? The cervical region of the uterus is the most likely site of successful implantation The myometrium contracts to expel the fetus during labor Mature sperm can actually survive in the female reproductive tract for several days The endometrium is the functional layer of zygote implantation True or False:            Cryptorchidism, or failure of testes to descend out of the abdomen decreases male fertility & is a major risk factor for...
Use the following setup to answer questions 1 – 9. SETUP: Four hundred households receive mortgage...
Use the following setup to answer questions 1 – 9. SETUP: Four hundred households receive mortgage loans from Packer Bank to buy homes. The buyers have an annual gross income of $45,000 and borrow $100,000 on a 30-year fixed rate loan of 6 percent. The annual real estate taxes and annual homeowners insurance premiums are $2,400 and $900, respectively. The borrowers also receive guarantees from the Federal Housing Administration (FHA). Packer Bank securitizes all the loans and sells them as...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT