MAX7456/examples/HelloWorld/HelloWorld.ino
Jens True 1e99abecab
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
Cleanup. Font writer included among examples
2021-03-19 18:07:21 +01:00

54 lines
956 B
C++

#include <SPI.h>
#include <MAX7456.h>
#define redLed 3
#define greenLed 4
MAX7456 osd;
unsigned long counter = 0;
byte tab[]={0xED,0xEE, 0xEF, 0xF3};
void setup()
{
SPI.begin();
osd.init(6);
osd.setDisplayOffsets(60,18);
osd.setBlinkParams(_8fields, _3BT_BT);
osd.activateOSD();
osd.printMAX7456Char(0x12,0,1);
osd.print("Hello world :)",1,3);
osd.print("Current time :",1,4);
osd.printMAX7456Char(0xFB,9,6,true);
osd.print("00'00\"",10,6);
osd.printMAX7456Chars(tab,sizeof(tab),12,7);
pinMode(redLed,OUTPUT);
pinMode(greenLed,OUTPUT);
//base time = 160ms,time on = time off.
}
void loop()
{
if(counter%2 == 0)
{
digitalWrite(redLed,LOW);
digitalWrite(greenLed,HIGH);
}
else
{
digitalWrite(redLed,HIGH);
digitalWrite(greenLed,LOW);
}
counter = millis()/1000;
osd.print(int(counter/60),10,6,2,0,false,true);
osd.print(int(counter%60),13,6,2,0,false,true);
delay(100);
}