Started a gui menuflow

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

main.cpp

Committer:
ahaas92
Date:
2020-06-11
Revision:
3:b029a3f73a9e
Parent:
2:5828e6917e75

File content as of revision 3:b029a3f73a9e:

#include "mbed.h"
#include "TS_DISCO_F429ZI.h"
#include "LCD_DISCO_F429ZI.h"
#include "Screens.h"
#include "Touch.h"
#include "main.h"

#define y_max 310
DigitalOut led1(LED1);

Ticker ts_service;
AnalogIn   pdiff(PC_5);
AnalogIn   p_guage(PC_4);

LCD_DISCO_F429ZI lcd;
TS_DISCO_F429ZI ts;

//PwmOut led(LED1);
PwmOut motor(PB_0);



uint8_t text[30];

uint16_t setPressure = 0;
ScreenState display_screen = StartUp; // StartScreen 
uint8_t status = 0;

int main()
{
    motor.period(0.1f);
       
    ts_service.attach(&CheckTs, 0.1); // the address of the function to be attached (flip) and the interval (2 seconds)  
    status= ts.Init(lcd.GetXSize(), lcd.GetYSize());
      
    wait(1);
    lcd.Clear(LCD_COLOR_DARKGRAY);
    lcd.SetBackColor(LCD_COLOR_DARKGRAY);
    lcd.SetTextColor(LCD_COLOR_WHITE);
  
    while(1)
    {
      CheckPress(display_screen);
      showScreen(display_screen,lcd);
    }
}