Version 1 (modified by 7 years ago) (diff) | ,
---|
The WeMos? D1 and clones is a single board computer based on the ESP8266 which combines a 32-bit RISC processor with a WiFi? transceiver. The WeMos? and clones are available on eBay, amazon, and AliExpress for $3.19.
It can be programmed using Arduino after installing support for the ESP8266 platform:
- Install board manager URL (http://arduino.esp8266.com/stable/package_esp8266com_index.json) in File->Preferences->Additional Board Manager URLs.
- 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:
- Tools->Board->Generic ESP8266 Module
- Tools->Flash Mode->DIO
- Tools->Flash Size->4M (1M SPIFFS)
- Tools->Reset Method->nodemcu
- Tools->CPU Frequency->160MHz
- Tools->Upload Speed->921600
- 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.