wiki:ArduinoWemos

Version 2 (modified by David Albert, 7 years ago) (diff)

--

The WeMos D1 and its clones are single board computers based on the ESP8266. They combine a 32-bit RISC processor with a WiFi? transceiver and 4MB of serial flash. These are cheaper and much more powerful than the traditional 8-bit AVR processors used in Arduino Uno and compatible boards, but they can still be programmed using the hobby-friendly Arduino environment. The boards are widely available at very low prices on eBay, amazon, and AliExpress for $3.19. It's hard to get a fast embedded system that you can put online for less money.

It can be programmed using Arduino after installing support for the ESP8266 platform:

  1. Install board manager URL (http://arduino.esp8266.com/stable/package_esp8266com_index.json) in File->Preferences->Additional Board Manager URLs.
  2. Install board manager Tools->Board->Boards Manager->esp8266 (at bottom of list)

Test by entering a basic sketch:

#define LED_BUILTIN 2

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  // initialize serial communications interface
  Serial.begin(115200);
}

// the loop function runs over and over again forever
void loop() {
  static uint32_t count;
  Serial.println(count++);
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}
  • Configure the interface to your board:
    1. Tools->Board->Generic ESP8266 Module
    2. Tools->Flash Mode->DIO
    3. Tools->Flash Size->4M (1M SPIFFS)
    4. Tools->Reset Method->nodemcu
    5. Tools->CPU Frequency->160MHz
    6. Tools->Upload Speed->921600
    7. Tools->Port-> <COM Port your board is on...see Windows Device Manager>
  • Compile your program (sketch) and upload it to the board by pressing the -> tool When the download finishes, the blue LED on your board should be blinking and if you launch the serial monitor (Magnifying glass tool in the far right of the toolbar), you should see your board sending out an increasing count every 2 seconds.

The WeMos D1 pin mappings are here