https://shop.mirotek.com.tw/arduino/arduino-start-18/
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
// **** Your english name here ****
lcd.print("Chang Yih Hua ");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}
//教學網址https://crazymaker.com.tw/arduino-lcd-i2c-tutorial/
#include<LiquidCrystal.h>
// LCD 接腳: RS, Enable, D4, D5, D6, D7
// Arduino 接腳: 12, 10, 5, 4, 3, 2
LiquidCrystal lcd(12, 10, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2); // 初始化 LCD,一行16的字元,共2行,預設開啟背光
pinMode(A0, INPUT);// 設定A0溫度輸入的類比值
Serial.begin(9600);// 設定序列埠速率
}
void loop()
{
float c = -40 + 0.488155 * (analogRead(A0)- 20);//溫度*C
float f = -40 + 0.878679 * (analogRead(A0)- 20);//溫度*F
Serial.print(c); //顯示攝氏溫度在序列視窗
Serial.println(" .C");
Serial.print(f);
Serial.println(" .F");
lcd.setCursor(0, 0); //顯示攝氏溫度在LCD
lcd.print(c);
lcd.setCursor(7, 0);
lcd.print(".C");
lcd.setCursor(0, 1);
lcd.print(f);
lcd.setCursor(7, 1);
lcd.print(".F");
delay(1000);
}
學生問卷填寫 https://reurl.cc/GXaLYx
上課資料