Skip to content

Working with SSD1306 display through ESP-8266 using Micropython

Notifications You must be signed in to change notification settings

Ignisor/ESP-Display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP-8266 display

Working with SSD1306 display through ESP-8266 using Micropython

Using:

Utilities

Erasing and flashing ESP

  • esp_erase.sh script can be used to easily erase and flash ESP from scratch. Usage:

    source esp_erase.sh [path_to_micropython_bin]
    
  • Uploading of files to the board can be easily done using esp_push.sh. Usage:

    source esp_push.sh
    

    This deletes all the files from the board and then uploads everithing from the esp/ dir.

Converting images

  • Use img_to_bin.py script to convert images to binary format. By default it gets all images from raw_images/ folders and then stores converted files to the esp/images/. You can change it by changing static variables in the script. Converter accepts any file format supported by Pillow. Usage is simple, just run:
    python img_to_bin.py
    
    Images are stored in .bin files. Encoding is simple each pixel is converted to 0-255 using PIL and then from 0-255 to 0-1 where 0 is black and 1 is white. Thats done simply by checking is value more than 127 or less. File is simply a sequence of 0s and 1s.

Display usage

Display is a subclass of SSD1306_I2C that implements some addictional methods.

  • hardware_scroll - Allows you to use hardware scroll that supported by SSD1306
  • clear - Fills display black and refreshes
  • draw_from_file - Allows you to draw binary image from file (use img_to_bin.py to convert image to supported format).
  • draw_from_sequence - Allows you to draw image from sequence. I suggest to use generators for better memory optimization.
  • draw_text - Helper that allows you to easily drow multiline text with auto wrapping

About

Working with SSD1306 display through ESP-8266 using Micropython

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published