ESP8266 Support WIKI

User Tools

Site Tools


arduino-docs

**This is an old revision of the document!**

Table of Contents


Arduiono IDE for ESP8266

Basic Arduino functions and classes

Standard Libs

Wire

content

EEPROM

content

ESP Specific Libs

SDK-API (1.0.0)

If you want to use some the the SDK-API functions have a look at this link http://bbs.espressif.com/viewtopic.php?f=5&t=286

The Documentation can be found here http://bbs.espressif.com/download/file.php?id=253

To use the API you have to include some header-files in your sketch. Below is a quick example of using the RTC-Memory-Write API to make a counter persistent even after using sleep + the following reset.

#include <Streaming.h>
 
// Include API-Headers
extern "C" {
#include "ets_sys.h"
#include "os_type.h"
#include "osapi.h"
#include "mem.h"
#include "user_interface.h"
#include "cont.h"
}
 
// Counter
uint32_t i = 0;
// Temporary buffer
uint32_t b = 0;
 
void setup() {
  Serial.begin(115200);
  // Call API-Function
  system_deep_sleep_set_option(4);
  // Call API-Function
  system_rtc_mem_read(64,&b,4) << endl;
  // Check if the value is within expected range
  if(b < 100000)
    i = b;
}
 
int lap = 0;
void loop() {
  for(int c = 0; c < 50; c++)
  {
    Serial << i++ << " " << lap << endl;
    delay(10);
  }
  // Call API-Function
  system_rtc_mem_write(64,&i,4) << endl;
  delay(1000);
  // Call API-Function
  system_deep_sleep(10000000);
  lap++;
}

ESP8266WiFi

content

ESP8266mDNS

content

ESP8266WebServer

content

arduino-docs.1427921662.txt.gz · Last modified: 2015/04/01 20:54 by cimba007

Page Tools