Day2 05_IR

2024. 1. 18. 19:54arduino

  • 적외선 센서 출력
const int IRPin = 2;
const int ledPin = 13;

void setup() {
  // put your setup code here, to run once:
  pinMode(IRPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int IRInput = digitalRead(IRPin);
  Serial.println(IRInput);
}




'arduino' 카테고리의 다른 글

Day3 01-dht11  (0) 2024.02.04
Day2 06_Debounce  (0) 2024.01.18
Day2 04_sonic  (0) 2024.01.18
Day2 03_sensor_led  (0) 2024.01.18
Day2 02_button  (0) 2024.01.18