MicroPython board ESP8266 D1R2 Uno-R3 format, Wi-Fi

MicroPython board ESP8266 D1R2 Uno-R3 format, Wi-Fi

MicroPython board ESP8266 NANO format, Wi-Fi

MicroPython board ESP8266 NANO format, Wi-Fi

MicroPython board ESP8266 mini format, Wi-Fi

Using MicroPython is a great way to get the most of your MicroPython ESP8266 D1 MINI board.
As low as $3.69
Availability: In stock
SKU
MP-ESP8266MINI

Using MicroPython is a great way to get the most of your MicroPython ESP8266 D1 MINI board. And vice versa, the MicroPython ESP8266 D1 MINI is a great platform for using MicroPython. With this board you can learn up MicroPython, getting a prompt, using WebREPL, connecting to the network and communicating with the Internet, using the hardware peripherals, and controlling some external components.

 

The MicroPython ESP8266 D1 MINI  connects to your PC over USB, giving you a USB flash drive on which to save your Python scripts. MicroPython ESP8266 D1 MINI is equipped with a micro USB connector for power and serial communications, 12 GPIO,  LED, and reset button. 

 

MicroPython is a complete rewrite of the Python (version 3.4) programming language so that it fits and runs on a microcontroller. It includes many optimizations so that it runs efficiently and uses very little RAM. Additionally, MicroPython runs bare-metal on the board and essentially gives you a Python operating system. The built-in  MicroPython ESP8266 D1 MINI  module contains functions and classes to control the peripherals available on the board, such as UART, I2C, SPI, ADC.

For additional thinks, you can to add to order, a USB cable and breadboard.

MakeCode:

Did you know that you can code your MicroPython ESP8266 D1 MINI  using Blocks, JavaScript, and Python? Try with Microsoft MakeCode: https://www.microsoft.com/en-us/makecode

 

What is Microsoft MakeCode?

Microsoft MakeCode is a free, open-source platform for creating engaging computer science learning experiences that support a progression path into real-world programming.

 

MSmakecode1

 

MSmakecode2

 

Running:

 

Connect your MicroPython ESP8266 D1 MINI to your PC (Windows, Mac or Linux) with a micro USB cable. There is only one way that the cable will connect, so you can’t get it wrong.

Your PC should now recognize the board. It depends on the type of PC you have as to what happens next:

  • Windows: Your MicroPython ESP8266 D1 MINI will appear as a removable USB flash drive. Windows may automatically pop-up a window, or you may need to go there using Explorer. Windows will also see that the board has a serial device, and it will try to automatically configure this device. If it does, cancel the process. We will get the serial device working in the next tutorial.
  • Mac: Your MicroPython ESP8266 D1 MINI will appear on the desktop as a removable disc. It will probably be called BFLASH. Click on it to open the board folder.
  • Linux: Your MicroPython ESP8266 D1 MINI  will appear as a removable medium. On Ubuntu it will mount automatically and pop-up a window with the board folder. On other Linux distributions, the board may be mounted automatically, or you may need to do it manually. At a terminal command line, type lsblk to see a list of connected drives, and then mount /dev/sdb1 (replace sdb1 with the appropriate device). You may need to be root to do this.

Okay, so you should now have the board connected as a USB flash drive, and a window (or command line) should be showing the files on the MicroPython ESP8266 D1 MINI drive.

The drive you are looking at is known as /flash by the board, and should contain the following 4 files:

  • boot.py – the various configuration options for the board. It is executed when the board boots up.
  • main.py – the Python program to be run. It is executed after boot.py.
  • README.txt – basic information about getting started with the board. This provides pointers for new users and can be safely deleted.
  • pybcdc.inf – the Windows driver file to configure the serial USB device. More about this in the next tutorial.
 
 
Now we are going to write our Python program, so open the main.py file in a text editor. On Windows, you can use notepad or any other editor. On Mac and Linux, use your favorite text editor. With the file open you will see it contains 1 line:
# main.py -- put your code here!

This line starts with a # character, which means that it is a comment. Such lines will not do anything and are there for you to write notes about your program.

Let’s add 2 lines to this main.py file, to make it look like this:

# main.py -- put your code here!
import pyb
pyb.LED(4).on()

The first line we wrote says that we want to use the module. This module contains all the functions and classes to control the features of the MicroPython ESP8266 D1 MINI.

The second line that we wrote turns the blue LED on: it first gets the LED class from the pyb module creates LED number 4 (the blue LED) and then turns it on.

To run this little script, you need to first save and close the main.py file, and then eject (or unmount) the board USB drive. Do this like you would a normal USB flash drive.

When the drive is safely ejected/unmounted you can get to the fun part: press the RST switch on the board to reset and run your script. The RST switch is the small black button just below the USB connector on the board, on the right edge.

When you press RST the green LED will flash quickly, and then the blue LED should turn on and stay on.

Congratulations! You have written and run your very first MicroPython program!

Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account
Fill in your delivery details to check available shipping options and calculate rates for this product. Total delivery fee for your order, you can find in cart.