跳到主要內容

 自 109 / 2 /25 起啟用

Arduino / 紅外線感測器 / 讀取紅外線感測器

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}
 
void loop() {
  // put your main code here, to run repeatedly:
  int distance=0;
  distance=analogRead(A0);
  Serial.println(distance);
  delay(1000);
}

消息公佈欄

時間類別單位標題發佈點閱
跳至網頁頂部