25) 무선 침임자 감지 시스템 : HC_12

byte PIR = 8 ; byte LED = 5 ; void setup() { pinMode(LED, OUTPUT) ; pinMode(PIR, INPUT) ; Serial.begin(9600); } void loop() { int V_PIR = digitalRead(PIR) ; if (V_PIR == 1) { Serial.print(‘o’); digitalWrite(LED, HIGH) ; delay(200); } if (V_PIR == 0 ) {...

아두이노 I2C 센서 만들기 | # 24

// I2C Slave : SVR-05_D #include <Wire.h> #define slave_adress 5 int TH_data[2] ; int count = 0; void setup() { Wire.begin(slave_adress); Wire.onRequest(requestEvent); Serial.begin(9600) ; } void requestEvent() { byte Value; switch (count) { case 0: Value = 255;...

아두이노 아날로그 온도-습도계 | # 23

// SVR-05-D Humidity & Temperature sensor void setup() { Serial.begin(9600) ; } void loop() { float temp = analogRead(A0) ; float humid = analogRead(A1) ; temp = (temp/1023.*5.)*33.3 ; // 5V, slope=33.3 humid = (humid/1023.*5.)*33.3 ; Serial.print(” temp =...