Na stronie Community STM32 udostępniono ładne obrazki "Powered by STM32", twórcy zachęcają do umieszczania
#include "myMATRIX.h"
#include <Wire.h>
#include <DS1307.h>
#define RowA_Pin 2
#define RowB_Pin 3
#define RowC_Pin 4
#define RowD_Pin 5
#define OE_Pin 6
#define Red_Pin 7
#define Green_Pin 8
#define CLK_Pin 9
#define STB_Pin 10
DS1307 clock;
RTCDateTime dt;
void setup ()
{
myMatrix.Init(Red_Pin, Green_Pin, CLK_Pin, RowA_Pin, RowB_Pin, RowC_Pin, RowD_Pin, OE_Pin, STB_Pin);
clock.begin();
// If date not set
if (!clock.isReady())
{
// Set sketch compiling time
clock.setDateTime(__DATE__, __TIME__);
}
}
char tablica[20];
void loop()
{
dt = clock.getDateTime();
String napis = "";
if ( dt.hour < 10 )
{
napis += "0";
}
napis += String(dt.hour);
napis += ":";
if ( dt.minute < 10 )
{
napis += "0";
}
napis += String(dt.minute);
napis.toCharArray(tablica, 20);
myMatrix.printString(2, 4, red, black, tablica);
myMatrix.drawVLine(0, 3, 11, green);
myMatrix.drawVLine(31, 3, 11, green);
myMatrix.drawHLine(0,31,11,green);
myMatrix.drawHLine(0,31,3,green);
delay(1000);
}
