Simple fish eat program

Dependencies:   mbed mbed-rtos N5110 ShiftReg Tone

main.cpp

Committer:
el18a2k
Date:
2021-04-20
Revision:
10:e221bd1ce3ec
Parent:
8:fe51fbf81dee
Child:
11:7c1e2a9303d3

File content as of revision 10:e221bd1ce3ec:

#include "mbed.h"
#include "rtos.h" //allows multiple threads to run at the same time: https://os.mbed.com/handbook/RTOS

#include "FishEngine.h"
#include "Sound.h"
#include "Settings.h"

/*TO DO:
* REMEMBER TO USE VERSION CONTROL 
*   implement sound on/off */

//Attach
N5110 lcd(p8,p9,p10,p11,p13,p21);
Joystick joystick(p20, p19);
Tone dac(p18);

//Objects
FishEngine fish;
Sound sound;
Settings settingsMain;
Thread thread;

void theme();

int main(){
    settingsMain.systemINIT( lcd, dac, joystick); //initialise board
    thread.start(theme);
    
    while(1){
        fish.titleSequence(lcd); //calls title sequence
        fish.mainMenu(lcd, dac, joystick);
    }
}

void theme(){
    sound.mainTheme(dac);
}