우노빅보드 13

Node-Red 대쉬보드로 UDP 데이터 송신

우노빅보드 + ESP8266 연결 우노빅보드와 ESP8266을 연결합니다. ESP8266 명령어 수행 함수 command 변수에 명령어를 전달하면 결과값을 프린트합니다. String esp8266Data(String command, const int timeout, boolean debug) { if (debug) { Serial.print("CMD: "); Serial.println(command); } String response = ""; esp8266Serial.print(command); long int time = millis(); while ( (time + timeout) > millis()) { while (esp8266Serial.available()) { char c = esp8266..

ESP8266 연결 & 이더넷 동작 테스트

우노빅보드 디지털핀 2번, 3번과 ESP8266 RX, TX를 연결합니다. 소프트웨어 시리얼을 이용하여 ESP8266을 사용합니다. #include #define DEBUG true #define RXPIN 3 #define TXPIN 2 SoftwareSerial esp8266Serial(RXPIN,TXPIN); //Pin 5 & 3 of Arduino as RX and TX. Connect TX and RX of ESP8266 respectively. String esp8266Data(String command, const int timeout, boolean debug) { String response = ""; esp8266Serial.print(command); long int time = mi..

우노빅보드 온도센서 연동 on Node-RED

우노빅보드 우노빅보드 9번핀과 온도센서 DHT11 시그널핀과 연결합니다. 아두이노 소스코드 #include #include #define DHTPIN 9 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); // 온도 습도 데이터 얻기 int temperature, humidity; // 온도 습도를 읽기전 하드웨어 컨트롤 int request_humidity_temperature() { int err; float h = dht.readHumidity(); float t = dht.readTemperature(); Serial.print(h); Serial.print(','); Serial.println(t); temperature = (int)t; humidity = (..