*實作注意事項:
(1)ESP8266模塊必須使用+3.3V,雖然板上Power端有外接一電池盒(可內置1.5V AA Size 3顆),但由於板載穩壓電路內置7333-1(3.3V低壓差穩壓IC)。所以在實際測試時,可外接電池盒4.5V供電使用。
(2)板上USB2Serial Pin處符號RXD插針,實際是連接至其上方ESP8266模塊中TXD接腳。
(3)板上USB2Serial Pin處符號TXD插針,實際是連接至其上方ESP8266模塊中RXD接腳。
(4) Connect the USB-TTL to pc and upload sketch to ESP-12
Note: GPIO0 should be LOW , CH_PD and RST should be HIGH for first time flashing the board
(5) 需按Reset 或是 9V轉3.3V 5V的 POWER SW 才能進入 upload sketch 上傳模式
(6) GPIO0 上傳後拔除接地
/*
ESP8266 Read input from GPIO14, write to on-board rgb_LED
=================================================================
Connect the USB-TTL to pc and upload sketch to ESP-12
Note: GPIO0 should be LOW
CH_PD and RST should be HIGH for first time flashing the board
GPIO0 should be LOW when uploading sketches
Remember use a 3.3V USB-TTL
connect RX of board to TX of usb and TX of board to RX
SKETCH:
edit auth code, ssid and pass
=================================================================
*/
int pin_Button12 = 12; //GPIO12 RGBLED
int pin_Button13 = 13; //GPIO13
int pin_Button14 = 14; //GPIO14 RGBLED
int pin_Button15 = 15; //GPIO15 RGBLED
void setup() {
pinMode(pin_Button12, OUTPUT);
pinMode(pin_Button13, OUTPUT);
pinMode(pin_Button15, OUTPUT);
pinMode(pin_Button14, INPUT_PULLUP);
}
void loop() {
if(digitalRead(pin_Button14)){
for (byte i=0;i<=5;i++) {
digitalWrite(pin_Button12, HIGH); //LED OFF
digitalWrite(pin_Button13, HIGH); //LED OFF
digitalWrite(pin_Button15, HIGH); //LED OFF
delay(500);
digitalWrite(pin_Button12, LOW); //LED ON
digitalWrite(pin_Button13, LOW); //LED ON
digitalWrite(pin_Button15, LOW); //LED ON
delay(500);
}
}
else {
digitalWrite(pin_Button12, LOW); //LED ON
digitalWrite(pin_Button13, LOW); //LED ON
digitalWrite(pin_Button15, LOW); //LED ON
}
}
參考
1)
http://yptsai7.wixsite.com/home/single-post/2015/06/17/ESP12-Test-Board-%E8%88%87-Blynk-App-%E6%87%89%E7%94%A82ESP12-Test-Board%E7%A1%AC%E9%AB%94%E4%BB%8B%E7%B4%B9
2)
http://www.instructables.com/id/ESP8266-ESP-12Standalone-Blynk-101/step1/The-Blynk-app/
沒有留言:
張貼留言