Created
June 3, 2020 23:48
-
-
Save nikeee/cf1005f79a82e9569ff809a753a0a3c6 to your computer and use it in GitHub Desktop.
IL0373F ESP8266 NodeMCU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "main.hpp" | |
/* | |
VCC -> 3V3 | |
GND -> GND | |
D/C -> D3 | |
SDI -> DD7 | |
CS -> D8 (SS) | |
CLK -> D5 | |
BUSY -> D2 | |
*/ | |
// We don't have a reset pin | |
#define RST -1 | |
GxIO_Class io(SPI, /* CS */ SS, /* D/C */ D3, RST); | |
GxEPD_Class display(io, RST, /* BUSY */ D2); | |
// More: | |
// https://github.com/ZinggJM/GxEPD/tree/master/examples | |
void setup() { | |
display.init(); | |
display.setRotation(1); | |
display.setFont(&FreeMonoBold9pt7b); | |
} | |
void loop() { | |
const GFXfont* f = &FreeMonoBold9pt7b; | |
display.fillScreen(GxEPD_WHITE); | |
display.setTextColor(GxEPD_BLACK); | |
display.setFont(f); | |
display.setCursor(0, 0); | |
display.println(); | |
display.setTextColor(GxEPD_RED); | |
display.print(millis() / 1000); | |
display.println(" s."); | |
display.setTextColor(GxEPD_BLACK); | |
// display.println(" !\"#$%&'()*+,-./"); | |
display.println("0123456789:;<=>?"); | |
// display.println("@ABCDEFGHIJKLMNO"); | |
display.setTextColor(GxEPD_RED); | |
display.println("`abcdefghijklmno"); | |
delay(10 * 1000); | |
display.print(millis() / 1000); | |
display.println(" s."); | |
display.update(); | |
delay(5 * 1000); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include <GxEPD.h> | |
#include <GxGDEW0213Z16/GxGDEW0213Z16.h> | |
#include <GxIO/GxIO_SPI/GxIO_SPI.h> | |
#include <GxIO/GxIO.h> | |
#include <Fonts/FreeMonoBold9pt7b.h> | |
// https://s3.amazonaws.com/randomnerdtutorials/jhdfsASDFJEWJjsdfajdsafJDAFSJafd/ESP8266_Pinout_Diagrams.pdf | |
#define D0 16 | |
#define D1 5 | |
#define D2 4 | |
#define D3 0 | |
#define D4 2 | |
#define D5 14 | |
#define D6 12 | |
#define D7 13 | |
#define D8 15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment