조도 센서

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d8fb6403-9ca3-4d0f-9362-cae20b80e3ae/Untitled.png

void setup() {
  Serial.begin(9600);
}

void loop(){
  int Light = analogRead(A0);
  Serial.println(Light);
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1b84486e-ec19-44bf-84da-f7ff818d3840/Untitled.png

  1. 꽂을때에 센서를 잘 꽂으세요!
  2. 저항에 따라서 출력되는 값이 많이 달라질수도 있어요. 제가 실습한 저항의 색상은 빨주검검갈 입니다.

가변저항

void setup() {
  Serial.begin(9600);
}

void loop(){
  int Light = analogRead(A0);
  Serial.println(Light);
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4ff73f08-5171-40a5-a222-c9df05514394/Untitled.png

과제 답안