Make sure you have:
- Installed the ESP8266 boards
- Installed the GxEPD2 library and it's dependencies
- Selected the board 'Generic ESP8266 Module'.
Configure the board as per the information below (the changes from default are highlighted):
- Upload Speed; “115200”
- CPU Frequency: “80 MHz”
- Crystal Frequency: “26 MHz”
- Flash Size: “4MB (FS:3MB OTA:~512KB)”
- Flash Mode: “DIO”
- Flash Frequency: “40MHz”
- Reset Method: “dtr (aka nodemcu)”
- Debug port: “Disabled”
- Debug Level: “None”
- IwIP Variant: “v2 Lower Memory”
- VTables: “Flash”
- Builtin Led: “2”
- Erase Flash: “Only Sketch”
- Port: This is the port that shows up once you turn on the CodeCard and press the 'A' button
- Programmer: “ArduinoISP”
Important: To make sure the board is recognised when uploading, make sure you press the 'A' button when you turn the board on!
GxEPD2_BW<GxEPD2_270, GxEPD2_270::HEIGHT> display(GxEPD2_270(/*CS=D8*/ 2, /*DC=D3*/ 0, /*RST=D4*/ 4, /*BUSY=D2*/ 5)); // 2.7" b/w 264x176
- Go the the sketchbook folder where the library is installed (can be found in Arduino preferences)
- Find the
libraries
folder - find the
Adafruit_GFX_Library
folder - Open the
Fonts
folder - Find the font you want and copy the filename
- In your sketch, include the file
#include <Fonts/#FONT_FILE.h>
- Set the font using the display.setFont command and appending the font name with & while also removing the .h extention
display.setFont(&FONT_NAME);
Note: The cursor automtically moves to the end of any text you display so it doesn't overlap, as well as wraps at the edge of the screen
display.setCursor(x,y);
Valid ranges are: x: 0 - 264, y: 0 - 176
Once the position, font and colour are configured, text can be displayed with:
display.print('TEXT HERE');
- GxEPD_WHITE
- GxEPD_BLACK
display.fillScreen(<COLOR>);
The D8 pin maps to pin 15 on the ESP board. Can set the pin to an digital output pin by:
pinMode(other_led, OUTPUT);