
ESP8266特点介绍
802.11 b/g/n
内置Tensilica L106 超低功耗 32 位微型 MCU,主频支持 80 MHz 和160 MHz,支持 RTOS
内置10 bit高精度ADC
内置TCP/IP协议栈
内置TR 开关、balun、LNA、功率放大器和匹配网络
内置PLL、稳压器和电源管理组件,802.11b 模式下+20 dBm的输出功率
A-MPDU 、 A-MSDU 的聚合和 0.4 s的保护间隔
WiFi @ 2.4 GHz,支持 WPA/WPA2 安全模式
支持AT远程升级及云端OTA升级
支持 STA/AP/STA+AP 工作模式
支持 Smart Config 功能(包括 Android 和 iOS 设备)
HSPI 、UART、I2C、I2S、IR Remote Control、PWM、GPIO
深度睡眠保持电流为 10 uA,关断电流小于 5 uA
2 ms 之内唤醒、连接并传递数据包
待机状态消耗功率小于1.0 mW (DTIM3)
工作温度范围:-40℃- 125℃
WeMos D1开发板
全称是WeMos D1 WiFI UNO R3开发板,基于ESP-8266,兼容Arduino。
有了这款物联网开发板,我们就可以愉快的使用arduino方式开发ESP8266,玩转物联网项目。
引脚
WeMos D1包含:
数字IO引脚11个。除了D0引脚外,其余引脚均支持pwm、I2C、中断、单总线。
模拟输入引脚1个(最大支持3.3v输入)。
模拟引脚仅有1个。数字引脚(包括RX,TX)共有11个
需要注意的一点是:WeMos D1上数字引脚的一侧引脚数量远大于11个,
这是因为该板上D3与D15、D4与D14、D5与D13、D6与D12、D7与D11、D9与板载LED 它们两两之间是互通的。

WeMos中定义的arduino引擎编号其实是与ESP8266上的GPIO引擎编号对应.即:
16=D2;
14 = D5/D13;
12 = D6/D12;
13 = D7/D11;
15 = D10;
2 = D9;
4 = D4;
5 = D3;
0 = D8;
引用引脚时直接输入引脚代码,写成D4也可以,很奇怪!
控制LED的代码如下:
void setup() {
pinMode(4, OUTPUT); // Initialize the LED_BUILTIN pin as an output
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(4, LOW); // Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is active low on the ESP-01)
delay(1000); // Wait for a second
digitalWrite(4, HIGH); // Turn the LED off by making the voltage HIGH
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
}