test de premier push

Dependencies:   WakeUp mbed EPD_GDE021A1

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers refreshScreen.cpp Source File

refreshScreen.cpp

00001 #include "mbed.h"
00002 #include "EPD_GDE021A1.h"
00003 #include "../Headers/refreshScreen.h"
00004 
00005 #define EPD_CS       PA_15
00006 #define EPD_DC       PB_11
00007 #define EPD_RESET    PB_2
00008 #define EPD_BUSY     PA_8
00009 #define EPD_POWER    PB_10
00010 #define EPD_SPI_MOSI PB_5
00011 #define EPD_SPI_MISO PB_4
00012 #define EPD_SPI_SCK  PB_3
00013 
00014 #define TAILLE_LIGNE  25
00015 
00016 EPD_GDE021A1 epd(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY, EPD_POWER, EPD_SPI_MOSI, EPD_SPI_MISO, EPD_SPI_SCK);//Parametre l'ecrant E-Ink
00017 
00018 void refreshScreen()
00019 {
00020     char ligne0[TAILLE_LIGNE];
00021     char ligne1[TAILLE_LIGNE];
00022     char ligne2[TAILLE_LIGNE];
00023     char ligne3[TAILLE_LIGNE];
00024     char ligne4[TAILLE_LIGNE];
00025     char ligne5[TAILLE_LIGNE];
00026     double poidsRuche;
00027     double temperatureRuche;
00028     double humiditeRuche;
00029     
00030     poidsRuche = 48.26;
00031     temperatureRuche = 12.3;
00032     humiditeRuche = 52.4;
00033     
00034     sprintf (ligne0, "Poids       =  %3.2f Kg", poidsRuche); 
00035     sprintf (ligne1, "Temperature =  %2.1f C", temperatureRuche); 
00036     sprintf (ligne2, "Humidite    =  %2.1f %%", humiditeRuche); 
00037     sprintf (ligne3, "123456789012345678901234"); 
00038     sprintf (ligne4, "123456789012345678901234"); 
00039     sprintf (ligne5, "123456789012345678901234");  
00040     /*
00041     sprintf (ligne2, "Le poids est de %3f Kg",poidsRuche);  
00042     sprintf (ligne3, "La temperature est de %3f C",temperatureRuche);  
00043     sprintf (ligne4, "L'humidite est de %3f %",humiditeRuche);    
00044     sprintf (ligne5, "on met autre chose");  
00045     */
00046     
00047     epd.Clear(EPD_COLOR_WHITE);  
00048 
00049     epd.DisplayStringAtLine(5, (uint8_t*)ligne0, LEFT_MODE);
00050     epd.DisplayStringAtLine(4, (uint8_t*)ligne1, LEFT_MODE);
00051     epd.DisplayStringAtLine(3, (uint8_t*)ligne2, LEFT_MODE);
00052     epd.DisplayStringAtLine(2, (uint8_t*)ligne3, LEFT_MODE);
00053     epd.DisplayStringAtLine(1, (uint8_t*)ligne4, LEFT_MODE);
00054     epd.DisplayStringAtLine(0, (uint8_t*)ligne5, LEFT_MODE);
00055     
00056     
00057     epd.RefreshDisplay();
00058 
00059 }