Simple fish eat program
Dependencies: mbed mbed-rtos N5110 ShiftReg Tone
Diff: classes/FishEngine.cpp
- Revision:
- 1:7dfa61225fcf
- Child:
- 2:532b0225519f
diff -r cf9660998431 -r 7dfa61225fcf classes/FishEngine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classes/FishEngine.cpp Fri Mar 19 17:28:12 2021 +0000 @@ -0,0 +1,36 @@ +#include "FishEngine.h" + +BusOut RGB_led(p24,p23,p22); //RGB bus MSB - LSB, inverted logic 1 = low + +ShiftReg shift; +Graphics graphics; + +DigitalIn button_A (p29); + +void FishEngine::system_init(N5110 &lcd, Tone &dac){ + lcd.init(); + lcd.setBrightness(0.5); + dac.init(); + shift.write(0x00); + RGB_led.write(0b111); +} + +void FishEngine::titleSequence(N5110 &lcd){ + button_A.mode(PullNone); + lcd.clear(); + graphics.titleScreen(lcd); + lcd.refresh(); + wait_ms(1000); + + while(button_A.read() == 0){ + lcd.clear(); + graphics.confirmationScreen(lcd); + lcd.refresh(); + wait_ms(1000/10); + } + + graphics.screenFlash(lcd); + lcd.refresh(); +} + +