아두이노에서 ESP8266 사용하기
- 아두이노 IDE는 1.6.4 이상의 버전을 설치
- 아두이노의 환경설정에서 추가적인 보드매니저 URLs에 다음과 같이 입력
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- 툴 > 보드매니저에서 ESP8266을 검색후 ESP8266 보드를 설치한다.
- 설치후 툴 > 보드 메뉴에서 가지고 있는 ESP8266보드를 선택한다.
- 이 보드의 관련 정보: https://github.com/nodemcu
- ESP8266 보드들의 비교: http://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/
핀레이아웃
간단한 Blink Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*
ESP8266 Blink by Simon Peter
Blink the blue LED on the ESP-01 module
This example code is in the public domain
The blue LED on the ESP-01 module is connected to GPIO1
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
*/
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is acive low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}
/* | |
ESP8266 Blink by Simon Peter | |
Blink the blue LED on the ESP-01 module | |
This example code is in the public domain | |
The blue LED on the ESP-01 module is connected to GPIO1 | |
(which is also the TXD pin; so we cannot use Serial.print() at the same time) | |
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED | |
*/ | |
void setup() { | |
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level | |
// but actually the LED is on; this is because | |
// it is acive low on the ESP-01) | |
delay(1000); // Wait for a second | |
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH | |
delay(2000); // Wait for two seconds (to demonstrate the active low LED) | |
} |