Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Startup/startup.cpp

Committer:
lukeocarwright
Date:
2020-05-19
Revision:
14:9cfe0041cc4e
Parent:
12:7a399a476cfd
Child:
31:cfdb014ff086

File content as of revision 14:9cfe0041cc4e:

#include "mbed.h"
#include "startup.h"

//objects
LUTs lut;

const int CART_SYNTH_LOGO[48][84] =   {  //STARTUP LOGO
    { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
    { 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0 },
    { 0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0 },
    { 0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0 },
    { 0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,1,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
};

//constructor/destructor
startup::startup()
{
}
startup::~startup()
{
}

//methods
void startup::initialise(N5110 &lcd, Gamepad &pad)
{
    pad.init(); //initiate Gamepad
    printf("Initialising Pad\n");
    lcd.init(); //intitates screen
    lcd.clear();
    lcd.setContrast(0.5); //contrast setting
    lcd.inverseMode(); //puts screen in -ve
    //Prints CART SYNTH to display
    lcd.drawSprite(0,0,48,84,(int *)CART_SYNTH_LOGO);
    lcd.refresh();
    lut.initial_wavetables();
    wait_ms(3000); //timer to allow theme to play out
    lcd.clear();
    lcd.refresh(); //sets clear screen
}