mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Update readme
[ci skip]
This commit is contained in:
parent
7e8cd1e7ef
commit
d06ec220fa
46
README.md
46
README.md
@ -19,9 +19,15 @@ $ cd Arduino/build
|
||||
$ ant dist
|
||||
```
|
||||
|
||||
### Supported boards ###
|
||||
- [Wifio](http://wifio.cc)
|
||||
- Generic esp8266 modules (without auto-reset support)
|
||||
|
||||
### Things that work ###
|
||||
|
||||
#### pinMode, digitalRead, digitalWrite, analogRead ####
|
||||
#### Basic Wiring functions ####
|
||||
|
||||
```pinMode```, ```digitalRead```, ```digitalWrite``` work as usual.
|
||||
|
||||
Pin numbers correspond directly to the esp8266 GPIO pin numbers. To read GPIO2,
|
||||
call ```digitalRead(2);```
|
||||
@ -31,14 +37,15 @@ GPIO16 can be ```INPUT``` or ```OUTPUT```.
|
||||
|
||||
```analogRead(0)``` reads the value of the ADC channel connected to the TOUT pin.
|
||||
|
||||
#### Pin interrupts (attachInterrupt, detachInterrupt) ####
|
||||
|
||||
Pin interrupts are supported through ```attachInterrupt```, ```detachInterrupt``` functions.
|
||||
Interrupts may be attached to any GPIO pin, except GPIO16. Standard Arduino interrupt
|
||||
types are supported: ```CHANGE```, ```RISING```, ```FALLING```.
|
||||
|
||||
#### shiftIn, shiftOut ####
|
||||
#### millis, micros ####
|
||||
#### delay, delayMicroseconds, yield ###
|
||||
#### Timing and delays ####
|
||||
```millis``` and ```micros``` return the number of milliseconds and microseconds elapsed after reset, respectively.
|
||||
|
||||
```delay``` pauses the sketch for a given number of milliseconds and allows WiFi and TCP/IP tasks to run.
|
||||
```delayMicroseconds``` pauses for a given number of microseconds.
|
||||
|
||||
Remember that there is a lot of code that needs to run on the chip besides the sketch
|
||||
when WiFi is connected. WiFi and TCP/IP libraries get a chance to handle any pending
|
||||
@ -53,9 +60,11 @@ more than 20 milliseconds is not recommended.
|
||||
|
||||
#### Serial ####
|
||||
|
||||
Only 8n1 is supported right now. By default the diagnostic output from WiFi
|
||||
libraries is disabled when you call ```Serial.begin```. To enable debug output again,
|
||||
call ```Serial.setDebugOutput(true);```
|
||||
```Serial``` object works much the same way as on a regular Arduino. Apart from hardware FIFO (128 bytes for TX and RX) HardwareSerial has additional 256-byte TX and RX buffers. Both transmit and receive is interrupt-driven. Write and read functions only block the sketch execution when the respective FIFO/buffers are full/empty.
|
||||
|
||||
Only 8n1 mode is supported right now.
|
||||
|
||||
By default the diagnostic output from WiFi libraries is disabled when you call ```Serial.begin```. To enable debug output again, call ```Serial.setDebugOutput(true);```
|
||||
|
||||
#### WiFi(ESP8266WiFi library) ####
|
||||
|
||||
@ -81,6 +90,7 @@ Library for calling functions repeatedly with a certain period. Two examples inc
|
||||
This is a bit different from standard EEPROM class. You need to call ```EEPROM.begin(size)```
|
||||
before you start reading or writing, size being the number of bytes you want to use.
|
||||
Size can be anywhere between 4 and 4096 bytes.
|
||||
|
||||
```EEPROM.write``` does not write to flash immediately, instead you must call ```EEPROM.commit()```
|
||||
whenever you wish to save changes to flash. ```EEPROM.end()``` will also commit, and will
|
||||
release the RAM copy of EEPROM contents.
|
||||
@ -89,8 +99,8 @@ Three examples included.
|
||||
|
||||
#### I2C (Wire library) ####
|
||||
|
||||
Only master mode works, and I haven't tested if Wire.setClock gives correct frequency.
|
||||
Before using I2C, you need to set pins you will use for SDA and SCL by calling
|
||||
Only master mode works, and ```Wire.setClock``` has not been verified to give exactly correct frequency.
|
||||
Before using I2C, pins for SDA and SCL need to be set by calling
|
||||
```Wire.pins(int sda, int scl)```, i.e. ```Wire.pins(0, 2);``` on ESP-01.
|
||||
|
||||
#### OneWire (from https://www.pjrc.com/teensy/td_libs_OneWire.html) ####
|
||||
@ -104,9 +114,14 @@ instead of the one that comes with the Arduino IDE (this one).
|
||||
Allows the sketch to respond to multicast DNS queries for domain names like "foo.local".
|
||||
See attached example and library README file for details.
|
||||
|
||||
#### Other libraries that don't rely on low-level access to AVR registers.
|
||||
#### Other libraries
|
||||
|
||||
Libraries that don't rely on low-level access to AVR registers should work well. Here are a few libraries that were verified to work:
|
||||
|
||||
- [PubSubClient](https://github.com/knolleary/pubsubclient) MQTT library - [sample](https://gist.github.com/igrr/7f7e7973366fc01d6393)
|
||||
- [DHT11](https://github.com/adafruit/DHT-sensor-library) - initialize DHT as follows: ```DHT dht(DHTPIN, DHTTYPE, 15);```
|
||||
- [DallasTemperature](https://github.com/milesburton/Arduino-Temperature-Control-Library.git)
|
||||
|
||||
- [PubSubClient](https://github.com/knolleary/pubsubclient) - [sample](https://gist.github.com/igrr/7f7e7973366fc01d6393)
|
||||
|
||||
#### Upload via serial port ####
|
||||
Select "esptool" as a programmer, and pick the correct serial port.
|
||||
@ -125,6 +140,11 @@ toggle power).
|
||||
- Upload sketches via WiFi. Conceptually and technically simple, but need to figure out how to provide the best UX for this feature.
|
||||
- Samples for all the libraries
|
||||
|
||||
### Issues and support ###
|
||||
|
||||
Forum: http://www.esp8266.com/arduino
|
||||
|
||||
Submit issues on Github: https://github.com/esp8266/Arduino/issues
|
||||
|
||||
### License and credits ###
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user