54 lines
No EOL
1.3 KiB
C++
54 lines
No EOL
1.3 KiB
C++
/*********************************************************************
|
|
* @file Apllication.cpp
|
|
* @author Montaigu Emilie, Ouvrard Marine
|
|
* @brief Fichier source de l'application
|
|
*********************************************************************/
|
|
#include "Application.h"
|
|
#include <Wire.h>
|
|
#include "rgb_lcd.h"
|
|
#include "ecran.h"
|
|
#include "bdd.h"
|
|
#include "bouton.h"
|
|
#define buttonPinRelief D8
|
|
#define buttonPinPlat D6
|
|
#define ledRougePin D7
|
|
|
|
Application::Application()
|
|
: ledPin(D7), colorR(255), colorG(100), colorB(100), boutonRelief(buttonPinRelief), boutonPlat(buttonPinPlat), ledRouge(ledRougePin){}
|
|
|
|
Application::~Application() {
|
|
/*if (boutonRelief != nullptr) {
|
|
delete boutonRelief;
|
|
}
|
|
if (boutonPlat != nullptr) {
|
|
delete boutonPlat;
|
|
}*/
|
|
}
|
|
|
|
void Application::init(void) {
|
|
Serial.begin(115200);
|
|
lcd.begin(32, 16);
|
|
lcd.setRGB(colorR, colorG, colorB);
|
|
pinMode(ledPin, OUTPUT);
|
|
pinMode(buttonPinRelief, INPUT);
|
|
pinMode(buttonPinPlat, INPUT);
|
|
delay(1500);
|
|
Serial.println("A");
|
|
}
|
|
|
|
|
|
void Application::run(void) {
|
|
gameOver = false;
|
|
nb_erreurs = 0;
|
|
lcd.clear();
|
|
lcd.print("C'est parti !");
|
|
delay(1500);
|
|
listequestions_init(lcd, boutonRelief, boutonPlat,ledRouge);
|
|
delay(100);
|
|
if (gameOver) {
|
|
lcd.clear();
|
|
lcd.setCursor(0, 0);
|
|
lcd.print("GAME OVER");
|
|
delay(5000);
|
|
}
|
|
} |