Day 16- P10 display using Nodemcu
Download Library
https://drive.google.com/file/d/11vkBCuNqPpMh7r5ixIsAD8LiH2Kav0Xd/view?usp=drive_link
///////////////////////////////////////////////////////////////
///////////// 2 line display on p10 board
#include <DMDESP.h>
#include <fonts/ElektronMart6x8.h>
//SETUP DMD
#define DISPLAYS_WIDE 2
#define DISPLAYS_HIGH 1
DMDESP Disp(DISPLAYS_WIDE, DISPLAYS_HIGH);
void setup() {
// DMDESP Setup
Disp.start();
Disp.setBrightness(100);
Disp.setFont(ElektronMart6x8);
}
void loop() {
Disp.loop();
Disp.drawText(0,0,"Manmohan Pal");
TeksJalan(8, 50);
}
static char *teks[] = {"Mobile no. +91 8989811397"};
void TeksJalan(int y, uint8_t kecepatan) {
static uint32_t pM;
static uint32_t x;
int width = Disp.width();
Disp.setFont(ElektronMart6x8);
int fullScroll = Disp.textWidth(teks[0]) + width;
if((millis() - pM) > kecepatan) {
pM = millis();
if (x < fullScroll) {
++x;
} else {
x = 0;
return;
}
Disp.drawText(width - x, y, teks[0]);
}
}
///////////////////////////////////////////////////////////
No comments:
Post a Comment