Skip to content

GillHawk/esp8266-micropython-cookbook

 
 

Repository files navigation

ESP8266 MicroPython Cookbook

Micropython-logo svg

I publish ESP8266/ESP32 MicroPyton projects from time to time on Hackster.io. Here I have some smaller project/scripts I wrote forMicroPython, in which I tried to make the code as simple as possible and only use built-in modules.

-- Alan Wang

Timer-Based Simple Web Clock on SSD1306

File: SimpleWebClockWithTimer.py

A mini web clock that update system RTC time every 15 minutes via NTP server. It uses two machine.timers instead of a while loop, reducing the code down to less than 40 actual lines. Change the SSID and PW to your own WiFi AP.

Display DHT11 Sensor Readings on SSD1306

File: DHT11_Sensor_SSD1306.py

A simple example of displaying DHT11's temperature and humidity readings on SSD1306 OLED as well as printing them in REPL. A very basic weather station.

Change dht.DHT11 to dht.DHT22 if you are using a DHT22 sensor.

Web JSON Query Template

File: WebJSONQuery_Template.py

A template for querying a API and get its JSON response. The JSON response would be a dictionary object, in which you can extract any data you need.

Note: if you get a SSL error (like "TLS buffer overflow" and/or "ssl_handshake_status: -xxx"), either your WiFi is unstable or the API is not fully supported by MicroPython.

WS2812 NeoPixel Rainbow/Rotation Effect

File: WS2812_NeoPixelRainbow.py

Generate rainbow colors on multiple NeoPixel leds and rotate them (clockwise or else). The number of LEDs and brightness level can be adjusted.

Conway's Game of Life on SSD1306

File: ConwayGameOfLife_SSD1306.py

Run the simulation of Conway's Game of Life on the SSD1306 OLED display. The rules and the size of cell matrix can both be adjusted.

About

Some simple and useful projects for MicroPython on ESP8266/ESP32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%