@@ -32,8 +32,8 @@ $ ant dist
32
32
Pin numbers correspond directly to the esp8266 GPIO pin numbers. To read GPIO2,
33
33
call ``` digitalRead(2); ```
34
34
35
- GPIO0-GPIO15 can be ``` INPUT ``` , ``` OUTPUT ``` , ``` INPUT_PULLUP ``` , and ``` OUTPUT_OPEN_DRAIN ``` .
36
- GPIO16 can be ``` INPUT ``` or ``` OUTPUT ``` .
35
+ GPIO0-GPIO15 can be ``` INPUT ``` , ``` OUTPUT ``` , ``` INPUT_PULLUP ``` , and ``` INPUT_PULLDOWN ``` .
36
+ GPIO16 can be ``` INPUT ``` , ``` OUTPUT ``` or ``` INPUT_PULLDOWN ``` .
37
37
38
38
``` analogRead(A0) ``` reads the value of the ADC channel connected to the TOUT pin.
39
39
@@ -47,6 +47,8 @@ types are supported: ```CHANGE```, ```RISING```, ```FALLING```.
47
47
#### Pin Functions ####
48
48
49
49
![ Pin Functions] ( https://raw.githubusercontent.com/Links2004/Arduino/esp8266/docs/pin_functions.png )
50
+ The most usable pin functions are mapped to the macro ``` SPECIAL ``` , so calling ``` pinMode(pin, SPECIAL) ```
51
+ will switch that pin in the most usable FUNCTION_X. Those are UART RX/TX on pins 1 - 3, HSPI for pins 12-15 and CLK functions for pins 0, 4 and 5.
50
52
51
53
#### Timing and delays ####
52
54
``` millis ``` and ``` micros ``` return the number of milliseconds and microseconds elapsed after reset, respectively.
@@ -123,9 +125,10 @@ Three examples included.
123
125
124
126
#### I2C (Wire library) ####
125
127
126
- Wire library currently supports master mode up to approximately 450KHz (at 80 MHz CPU clock) .
128
+ Wire library currently supports master mode up to approximately 450KHz.
127
129
Before using I2C, pins for SDA and SCL need to be set by calling
128
- ``` Wire.begin(int sda, int scl) ``` , i.e. ``` Wire.begin(0, 2); ``` on ESP-01.
130
+ ``` Wire.begin(int sda, int scl) ``` , i.e. ``` Wire.begin(0, 2); ``` on ESP-01,
131
+ else they default to pins 4(SDA) and 5(SCL).
129
132
130
133
#### SPI ####
131
134
0 commit comments