Max7456
Class representing a max7456
 All Classes Files Functions Variables Typedefs Enumerator Macros Pages
Max7456WriteTable.cpp
// Do not remove the include below
#include "Max7456WriteTable.h"
void setup()
{
//Sample code : Write a complete table of character in the character memory of the max7456.
charact currentChar; //represents a character as stored in memory (byte[54])
Serial.begin(115200);
osd = new Max7456(9); //new Max7456 with CS on pin 9.
Serial.println("INSERTING CHARACTERS TABLE IN MAX7456");
Serial.println("ARE YOU SURE ? (y/n)");
bool goodChar = false;
osd->activateOSD(false); // Deactivate osd display.
//Just some serial manipulations
while(!goodChar)
{
while(!Serial.available() );
char found;
found = char(Serial.read());
goodChar = (found == 'y' || found == 'Y');
if(found == 'n' || found == 'N')
{
Serial.println("------ NOTHING DONE ------");
Serial.println("please unplug your arduino");
while(true);
}
}
char number[]="000";
for(int i = 0 ; i <= 0xff;i++)
{
Serial.print("inserting ");
dtostrf(i,3,0,number);
Serial.print(number);
Serial.print(" / 255");
Max7456::getCARACFromProgMem(i,currentChar); //Because the table is too big for ram memory
osd->sendCharacter(currentChar,i); //We send currentChar at address i.
for(int j=0 ; j<19 ; j++) //Rewind Serial.
Serial.print(char(0x08));
}
Serial.println("--------- DONE ! ---------");
Serial.println("please unplug your arduino");
}
void loop()
{
//Nothing done here
}