請鍵入下列程式: #define CDS A1 #define MIC A0 #include <LiquidCrystal_I2C.h> #define Addr 0x27 LiquidCrystal_I2C LCD(Addr,16,2); void setup() { LCD.begin(); pinMode(CDS,INPUT); LCD.clear(); LCD.setCursor(0,0);LCD.print("CDS:"); LCD.setCursor(0,1);LCD.print("MIC:"); } void loop() { LCD.setCursor(4,0);LCD.print(analogRead(CDS));LCD.print(" "); LCD.setCursor(4,1);LCD.print(analogRead(MIC));LCD.print(" "); delay(200); } |