/*
- Contoh penggunaan library DMDESP
- email : bonny@grobak.net - www.grobak.net - www.elektronmart.com
*/
#include <DMDESP.h>
#include <fonts/ElektronMart6x8.h>
#include <fonts/Mono5x7.h>
//SETUP DMD
#define DISPLAYS_WIDE 1 // Kolom Panel
#define DISPLAYS_HIGH 1 // Baris Panel
DMDESP Disp(DISPLAYS_WIDE, DISPLAYS_HIGH); // Jumlah Panel P10 yang digunakan (KOLOM,BARIS)
//----------------------------------------------------------------------
// SETUP
void setup() {
// DMDESP Setup
Disp.start(); // Jalankan library DMDESP
Disp.setBrightness(50); // Tingkat kecerahan
Disp.setFont(Mono5x7); // Tentukan huruf
}
//----------------------------------------------------------------------
// LOOP
void loop() {
Disp.loop(); // Jalankan Disp loop untuk refresh LED
Disp.drawText(4, 0, "uteh"); // Tampilkan teks
Scrolling_Text(9, 50); // Tampilkan teks berjalan TeksJalan(posisi y, kecepatan);
}
//--------------------------
// TAMPILKAN SCROLLING TEKS
static const char *Text[] = {"NodeMCU ESP8266 P10 LED Panel with DMSESP"};
void Scrolling_Text(int y, uint8_t scrolling_speed) {
static uint32_t pM;
static uint32_t x;
int width = Disp.width();
Disp.setFont(Mono5x7);
int fullScroll = Disp.textWidth(Text[0]) + width;
if((millis() - pM) > scrolling_speed) {
pM = millis();
if (x < fullScroll) {
++x;
} else {
x = 0;
return;
}
Disp.drawText(width - x, y, Text[0]);
}
}
Result
. Variables and constants in RAM (global, static), used 28224 / 80192 bytes (35%)
β SEGMENT BYTES DESCRIPTION
β ββ DATA 1504 initialized variables
β ββ RODATA 968 constants
βββ BSS 25752 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60583 / 65536 bytes (92%)
β SEGMENT BYTES DESCRIPTION
β ββ ICACHE 32768 reserved space for flash instruction cache
βββ IRAM 27815 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 237076 / 1048576 bytes (22%)
β SEGMENT BYTES DESCRIPTION
βββ IROM 237076 code in flash
esptool.py v3.0
Serial port COM12
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: c8:c9:a3:54:e8:aa
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 271520 bytes to 200433...
Writing at 0x00000000... (7 %)
Writing at 0x00004000... (15 %)
Writing at 0x00008000... (23 %)
Writing at 0x0000c000... (30 %)
Writing at 0x00010000... (38 %)
Writing at 0x00014000... (46 %)
Writing at 0x00018000... (53 %)
Writing at 0x0001c000... (61 %)
Writing at 0x00020000... (69 %)
Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 271520 bytes (200433 compressed) at 0x00000000 in 17.8 seconds (effective 121.8 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...