This tutorial takes full advantage of the ESP8266 WiFi chip by serving a local webpage to control the general purpose input and output (GPIO) pins on a NodeMCU microcontroller. Some basic HTML and CSS programming methods will be utilized to create a stylish webpage that is both asynchronous (AJAX) and input-driven - this will give the user the ability to control the pins on the microcontroller. For the current example, an electromagnet and LED will be controlled using pulse width modulation (PWM) and simple high/low logic, respectively. The PWM control allows the user to change the voltage to the component, altering the magnetic field of the electromagnet. For the LED, the traditional digitalWrite() method will turn the LED on and off.
Read MoreNodeMCU is a WiFi platform that integrates the ESP8266 system on chip hardware with the familiarities of open-source software. The NodeMCU is powerful because it endows users with the ability to create Internet of Things (IoT) projects at a relatively low cost with tools readily available and open to the maker community. NodeMCU is fully compatible with the Arduino IDE, which is the method for programming the board in this tutorial.
Read More