What is the purpose of the following code? [code] void setup() { Seria.begin(9600); } void setup() { Serial.write(40); } [/code]

Ngọc Trâm

New member
What is the purpose of the following code?
Code:
void setup() {
    Seria.begin(9600);
}
void setup() {
    Serial.write(40);
}
A. Send a byte with value 40 through the Serial pins
B. Send a signal to pin 40 on the Arduino board
C. Send a hexadecimal number of 40 through the Serial pins
D. Send a octal number of 40 through the Serial pins
 
Answer: A
Explanation: The above code uses the serial pins on the Arduino Board. The data is sent in the form of a byte whose value is 40. This data is processed into a data packet where the additional sections are added to number 40 and then send using UART.
 

Tìm kiếm

Back
Top