Created
April 26, 2021 14:48
-
-
Save nezuppo/ae4fa119782325c2334fbfd249678162 to your computer and use it in GitHub Desktop.
This file contains 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 <M5StickC.h> | |
#define LGFX_AUTODETECT | |
#include <LovyanGFX.hpp> | |
static LGFX gfx; | |
void setup() { | |
M5.begin(); | |
gfx.init(); | |
gfx.setRotation(1); | |
gfx.fillScreen(TFT_BLACK); | |
gfx.setTextColor(TFT_WHITE, TFT_BLACK); | |
gfx.setFont(&fonts::lgfxJapanGothic_16); | |
gfx.setBrightness(100); | |
gfx.setTextSize(1); | |
gfx.setCursor(0, 0); | |
gfx.setTextScroll(true); | |
gfx.setScrollRect(0, 0, gfx.width(), gfx.height()); | |
Serial.begin(9600); | |
} | |
void loop() { | |
M5.update(); | |
if (Serial.available()) { | |
int inByte = Serial.read(); | |
if (inByte == '\r') | |
gfx.print("\n"); | |
else | |
gfx.printf("%c", inByte); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment