토양수분센서

토양수분센서

Makerist 0 767

// 토양 센서의 아날로그 핀
const int soilSensorPin = A0; // 토양 센서를 A0 핀에 연결했다고 가정합니다.


void setup() {
  // 시리얼 통신 시작
  Serial.begin(9600);
}


void loop() {
  // 토양 센서 값 읽기
  int soilMoisture = analogRead(soilSensorPin);
  
  // 토양 수분 값을 시리얼 모니터에 출력
  Serial.print("토양 수분: ");
  Serial.println(soilMoisture);
  
  // 잠시 대기
  delay(1000);
}

0 Comments