Commissioning of the WEMOS D1 Mini

First approach to realize how a microcontroller plattform works is to implement really simple solutions to understand the process of connecting hardware to the board and develop appropriate programs.

Working task

Commission the microcontroller using the manufacturer’s instructions, program the device with the example code shown in the information section and connect LEDs to display the output signals.

Programming of the microcontroller

For programming the Arduino development environment can be used. On the manufacturer’s website of the microcontroller is a good guide available that shows how the microcontroller can be programmed.

Use of the IOs

The inputs and outputs of the microcontroller can be used in the usual Arduino way.

Below is an example to be developed in the context of this project (so it may seem more complicated than necessary at the moment).

#include <ESP8266WiFi.h>

// local hardware
const int leds[]={D7, D8};
const int ledCount = 2;
const int signalFan = D7;
const int signalHeating = D8;

int blink = LOW;

void setup() {
 Serial.begin(9600);
 for(int i=0; i<ledCount; i++)
   pinMode(leds[i], OUTPUT);
}

void processOutputs() {
 digitalWrite(signalFan, blink);
 digitalWrite(signalHeating, blink);
}

void loop() {
 blink = blink==LOW ? HIGH : LOW;
 processOutputs();
 delay(1000);
}

Leave a Reply