Read more
Untuk membuat Membuar Running Text Geser Ke Kiri Dengan arduino uno dan p10 dengan library DMD3
Anda butuh :
kabel jumper p10
konektor p10
arduino uno
library DMD 3, download di sini
untuk koding nya dalah sebagai berikut :
/*
This example demonstrates how to use the DMD and related classes to
draw things on a Freetronics Large Dot Matrix Display.
This example is placed into the public domain.
*/
#include <DMD3.h>
#include <DejaVuSans9.h>
#include <DejaVuSansBold9.h>
#include <DejaVuSansItalic9.h>
#include <Mono5x7.h>
DMD3 display;
void scan()
{
display.refreshP10Z();
}
void setup() {
Timer1.initialize(2000);
Timer1.attachInterrupt(scan);
Timer1.pwm(9,255);
}
void loop() {
// drawShapes();
drawMarquee();
delay(500);
}
void drawShapes()
{
display.drawRect(0, 0, display.width() - 1, display.height() - 1);
}
static const char message[] = "Eat at Joes! ";
void drawMarquee()
{
int width = display.width();
display.setFont(DejaVuSans9);
int msgWidth = display.textWidth(message);
int fullScroll = msgWidth + width + 1;
for (int x = 0; x < fullScroll; ++x) {
//display.clear();
display.drawText(width - x, 3, message);
delay(100);
}
}
0 Reviews
Silakan dikomentari