mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
commit
c5cb80ecf5
11
README.md
11
README.md
@ -32,8 +32,8 @@ $ ant dist
|
|||||||
Pin numbers correspond directly to the esp8266 GPIO pin numbers. To read GPIO2,
|
Pin numbers correspond directly to the esp8266 GPIO pin numbers. To read GPIO2,
|
||||||
call ```digitalRead(2);```
|
call ```digitalRead(2);```
|
||||||
|
|
||||||
GPIO0-GPIO15 can be ```INPUT```, ```OUTPUT```, ```INPUT_PULLUP```, and ```OUTPUT_OPEN_DRAIN```.
|
GPIO0-GPIO15 can be ```INPUT```, ```OUTPUT```, ```INPUT_PULLUP```, and ```INPUT_PULLDOWN```.
|
||||||
GPIO16 can be ```INPUT``` or ```OUTPUT```.
|
GPIO16 can be ```INPUT```, ```OUTPUT``` or ```INPUT_PULLDOWN```.
|
||||||
|
|
||||||
```analogRead(A0)``` reads the value of the ADC channel connected to the TOUT pin.
|
```analogRead(A0)``` reads the value of the ADC channel connected to the TOUT pin.
|
||||||
|
|
||||||
@ -47,6 +47,8 @@ types are supported: ```CHANGE```, ```RISING```, ```FALLING```.
|
|||||||
#### Pin Functions ####
|
#### Pin Functions ####
|
||||||
|
|
||||||

|

|
||||||
|
The most usable pin functions are mapped to the macro ```SPECIAL```, so calling ```pinMode(pin, SPECIAL)```
|
||||||
|
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.
|
||||||
|
|
||||||
#### Timing and delays ####
|
#### Timing and delays ####
|
||||||
```millis``` and ```micros``` return the number of milliseconds and microseconds elapsed after reset, respectively.
|
```millis``` and ```micros``` return the number of milliseconds and microseconds elapsed after reset, respectively.
|
||||||
@ -123,9 +125,10 @@ Three examples included.
|
|||||||
|
|
||||||
#### I2C (Wire library) ####
|
#### I2C (Wire library) ####
|
||||||
|
|
||||||
Wire library currently supports master mode up to approximately 450KHz (at 80 MHz CPU clock).
|
Wire library currently supports master mode up to approximately 450KHz.
|
||||||
Before using I2C, pins for SDA and SCL need to be set by calling
|
Before using I2C, pins for SDA and SCL need to be set by calling
|
||||||
```Wire.begin(int sda, int scl)```, i.e. ```Wire.begin(0, 2);``` on ESP-01.
|
```Wire.begin(int sda, int scl)```, i.e. ```Wire.begin(0, 2);``` on ESP-01,
|
||||||
|
else they default to pins 4(SDA) and 5(SCL).
|
||||||
|
|
||||||
#### SPI ####
|
#### SPI ####
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user