0% found this document useful (0 votes)
177 views

#Include SPI.h

This document contains code for controlling a dot matrix display (DMD) to display scrolling text and custom logos. It includes functions for initializing the DMD, clearing the screen, selecting fonts, drawing characters, and scrolling text as a marquee. The main loop calls functions to first display a custom "Elektro" logo, then clear the screen and draw scrolling text, and finally clear the screen again.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views

#Include SPI.h

This document contains code for controlling a dot matrix display (DMD) to display scrolling text and custom logos. It includes functions for initializing the DMD, clearing the screen, selecting fonts, drawing characters, and scrolling text as a marquee. The main loop calls functions to first display a custom "Elektro" logo, then clear the screen and draw scrolling text, and finally clear the screen again.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <SPI.

h>
#include <DMD.h>
#include <TimerOne.h>
#include <Arial_Black_16_ISO_8859_1.h>
#include <LogoElektro.h>

// Deklarasi Fungsi
#define DISPLAYS_ACROSS 2
#define DISPLAYS_DOWN 1

DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);

void ScanDMD ( )
{
dmd.scanDisplayBySPI ( );
}

void setup ( ){

// Setup DMD
delay(1000);
Serial.begin(9600);
Timer1.initialize( 1500 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
}

void Logoelektro ( ){

dmd.selectFont(LogoElektro);
dmd.drawChar( 16, 0, '2', GRAPHICS_NORMAL);
delay(200);
dmd.drawChar( 16, 0, '3', GRAPHICS_NOR);
delay(200);
dmd.drawChar( 7, 0, '4', GRAPHICS_NOR);
dmd.drawChar( 25, 0, '5', GRAPHICS_NOR);
delay(200);
dmd.drawChar( 0, 0, '4', GRAPHICS_NOR);
dmd.drawChar( 32, 0, '5', GRAPHICS_NOR);
delay(200);

dmd.drawChar( 16, 0, '3', GRAPHICS_OR);


delay(500);

dmd.drawChar( 16, 0, '3', GRAPHICS_OR);


dmd.drawChar( 7, 0, '4', GRAPHICS_OR);
dmd.drawChar( 25, 0, '5', GRAPHICS_OR);
delay(500);

dmd.drawChar( 16, 0, '3', GRAPHICS_OR);


dmd.drawChar( 7, 0, '4', GRAPHICS_OR);
dmd.drawChar( 25, 0, '5', GRAPHICS_OR);
dmd.drawChar( 0, 0, '4', GRAPHICS_OR);
dmd.drawChar( 32, 0, '5', GRAPHICS_OR);
delay(500);
}

void DrawMHD ( ){
// Running Text
dmd.clearScreen( true );
dmd.selectFont(Arial_Black_16_ISO_8859_1);
dmd.drawMarquee("MUHILHAM.COM",12,(32*DISPLAYS_ACROSS)-1,0);
long start=millis( );
long timer=start;
boolean ret=false;
while(!ret){
if ((timer+40) < millis( )) {
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}
}

void loop ( ){
Logoelektro( );
delay(500);
dmd.clearScreen(true);
DrawMHD();
dmd.clearScreen(true);
}

You might also like