아두이노

ESP32 UNO D1 R32보드 – SimpleWIFIServer
▶ ESP32 UNO D1 R32보드 – SimpleWIFIServer #include const char* ssid = "JYPC"; const char* password = "12345678"; WiFiServer server(80); void setup() { Serial.begin(115200); pinMode(26, OUTPUT); // set the LED pin mode delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); WiFi.begin(ssid, password); while (Wi..

ESP32 UNO D1 R32보드-와이파이 통신
▶ 와이파이 통신 #include const char* ssid = "JYPC"; const char* password = "12345678"; const char* host = "172.30.1.33"; //const char* streamId = "...................."; //const char* privateKey = "...................."; void setup() { Serial.begin(115200); delay(10); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); W..
안드로이드 폰 블루투스 이용한 아두이노
▶안드로이드 핸드폰 블루투스 통한 아두이노 연결 #include "BluetoothSerial.h" BluetoothSerial SerialBT; void setup() { Serial.begin(115200); SerialBT.begin("Team1_jy"); Serial.println("The device started, now you can pair it with bluetooth!"); } void loop() { if (Serial.available()) { SerialBT.write(Serial.read()); } if (SerialBT.available()) { Serial.write(SerialBT.read()); } delay(20); } ▶안드로이드 핸드폰 블루투스 통한 아두이노 연결 ..

▶ESP32 UNO D1 R32 보드
▶ ESP32 UNO D1 R32 보드 이용해서 led 불켜기 void setup() { pinMode(26, OUTPUT); } void loop() { digitalWrite(26, HIGH); delay(1000); digitalWrite(26, LOW); delay(1000); } ▶ led 불 점점 밝아지기 void setup() { // PWM제어 설정 ledcSetup(0, 5000, 8); // PWM 핀번호 설정 ledcAttachPin(26, 0); } void loop() { for(int i = 0; i
Serial 통신
▶Serial 모니터 아두이노로 송수신된 데이터를 모니터링 하거나 데이터를 아두이노로 전송하는 툴이다. ▶Serial 통신 USB를 통해 아두이노와 PC 또는 다른 시리얼 장치 간에 정보를 송수신하는 것 Serial.begin() Serial.print() Serial.prinln() Serial.available() : 전송한 데이터가 있는지 확인하는 용도, 돌아오는 결과값은 사용가능한 데이터 개수를 리턴해줌. 읽어올 수 있는 문자(바이트) 수 반환(int형) ex) a,b,c,d 보내면 4를 리턴/ if문에 사용/ Serial.read() : 전송한 데이터 읽어올 때 사용(char형), 한문자씩 읽어옴/ 데이터 없을땐 –1 리턴함 Serial.parseInt() : 전송한 데이터 읽어올 때 사용(in..