Giter Club home page Giter Club logo

wemos-d1-mini-nokia-5110-pcd8544's Introduction

WeMos D1 Mini + Nokia 5110 PCD8544 LCD Module

The D1 mini board: http://wemos.cc

Tool used to convert .bmp to byte arrays: http://javl.github.io/image2cpp/

Materials:

  • WeMos D1 Mini
  • Nokia 5110 PCD8544 84x48 monochrome LCD
  • 8 jumper wires
  • breadboard

Dependencies:

Add these to your Arduino IDE using Manage Libraries.

Breadboard connections:

WeMos D1 Mini Nokia 5110 PCD8544 LCD Description
D2 (GPIO4) 0 RST Output from ESP to reset display
D1 (GPIO5) 1 CE Output from ESP to chip select/enable display
D6 (GPIO12) 2 DC Output from display data/command to ESP
D7 (GPIO13) 3 Din Output from ESP SPI MOSI to display data input
D5 (GPIO14) 4 Clk Output from ESP SPI clock
3V3 5 Vcc 3.3V from ESP to display
D0 (GPIO16) 6 BL 3.3V to turn backlight on, or PWM
G 7 Gnd Ground

These connections are common to all examples.

The backlight (BL) is optional. If you would like full brightness all the time, connect BL to 3V3 and save D0 for something else.

Byte Arrays

I used this tool to convert bitmap images into byte arrays. http://javl.github.io/image2cpp/

The Adafruit library drawBitmap() expects steam of bytes which are drawn horizontally. The first 0xFF in the array represents the first 8x pixels in the top left corner moving to the right.

Each rows last byte needs to be padded with least significant bits to make it a full byte.

I expected a 5x2 black square image would be exactly 10 bits in the array, however, it appears you need 16 bits with 3 padding bits at the end of each row.

The padding least significant bits in the last byte per row are seemingly ignored.

// 5x2 black rectangle
ABCDE
FGHIJ

// last byte on each row zero padded
ABCDE000
FGHIJ000

// as bits
11111000
11111000

// as bytes
0B11111000, 0B11111000
0xF8, 0xF8
// 9x2 black rectangle
ABCDEFGHI
JKLMNOPQR

// last byte on each row zero padded
ABCDEFGH I0000000
JKLMNOPQ R0000000

// as bits
11111111 10000000
11111111 10000000

// as bytes
0B11111111, 0B10000000, 0B11111111, 0B10000000
0XFF, 0x80, 0XFF, 0x80

To make the image2cpp tool output an Adafruit compatible byte array, you need to upload an image then round up the width to make it divisble by 8. eg. Upload a 84x48 image, then adjust the width to 88x48 then generate the bytes. Upload a 9x2 image and you need to change the size to 16x2 then generate.

The internal buffer in the library stores the bits in 6 rows of 84x columns of 8 bits. Completely different to what drapBitmap() accepts!

wemos-d1-mini-nokia-5110-pcd8544's People

Contributors

mcauser avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.