Lab Code Flashcards
Serial.print (“temperature”)
output to serial monitor without enter
Serial.printIn (temperature)
output to serial monitor with enter
constant int colorR = 255;
constant int colorG = 0;
constant int colorB = 0;
3 variable to store the color intensity for red, green and blue respectively.
lcd.begin (16, 2);
Initiate LCD display into 2 rows and 16 column
lcd.setRGB (colorR, colorG, colorB);
Setting the backlight color according to the value store in the variables
lcd.print(“Hello World”)
“lcd.print” is the standard function to output to the display.
lcd.setCursor(0,1);
“lcd.setCursor” is to locate the cursor to the position with “lcd.print” can out put the text
Serial.begin(9600)
To initiate connection to serial monitor window. 9600 is the baud rate.
How do you read digital signals?
There will be no “D” in front but just pin number.
Eg. digitalRead(5, HIGH)
How to you write digital signals?
There will be no “D” in front but just pin number.
Eg. digitalWrite(5, HIGH)
How do you read analog signals?
There will be an “A” in front
Eg. analogRead(A0)