test de premier push
Dependencies: WakeUp mbed EPD_GDE021A1
Diff: Sources/refreshScreen.cpp
- Revision:
- 22:cbc76ab6a864
- Parent:
- 17:3f52db5f8b42
- Child:
- 23:a56c813ac52c
--- a/Sources/refreshScreen.cpp Fri Nov 11 19:26:24 2016 +0000 +++ b/Sources/refreshScreen.cpp Sat Nov 12 10:27:20 2016 +0000 @@ -11,17 +11,18 @@ #define EPD_SPI_MISO PB_4 #define EPD_SPI_SCK PB_3 +#define TAILLE_LIGNE 25 + 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 void refreshScreen() { - - - char ligne1[100]; - char ligne2[100]; - char ligne3[100]; - char ligne4[100]; - char ligne5[100]; + char ligne0[TAILLE_LIGNE]; + char ligne1[TAILLE_LIGNE]; + char ligne2[TAILLE_LIGNE]; + char ligne3[TAILLE_LIGNE]; + char ligne4[TAILLE_LIGNE]; + char ligne5[TAILLE_LIGNE]; double poidsRuche; double temperatureRuche; double humiditeRuche; @@ -30,20 +31,27 @@ temperatureRuche = 12.34; humiditeRuche = 52.47; - sprintf (ligne1, "La ruche pese actuelement %3fKg",poidsRuche); - sprintf (ligne2, "La temperature est de %3f C",temperatureRuche); - sprintf (ligne3, "L'humidite est de %3f %",humiditeRuche); - sprintf (ligne4, "et la"); + sprintf (ligne0, "123456789012345678901234"); + sprintf (ligne1, "123456789012345678901234"); + sprintf (ligne2, "123456789012345678901234"); + sprintf (ligne3, "123456789012345678901234"); + sprintf (ligne4, "123456789012345678901234"); + sprintf (ligne5, "123456789012345678901234"); + /* + sprintf (ligne2, "Le poids est de %3f Kg",poidsRuche); + sprintf (ligne3, "La temperature est de %3f C",temperatureRuche); + sprintf (ligne4, "L'humidite est de %3f %",humiditeRuche); sprintf (ligne5, "on met autre chose"); - + */ epd.Clear(EPD_COLOR_WHITE); - epd.DisplayStringAtLine(5, (uint8_t*)ligne1, CENTER_MODE); - epd.DisplayStringAtLine(4, (uint8_t*)ligne2, CENTER_MODE); - epd.DisplayStringAtLine(3, (uint8_t*)ligne3, CENTER_MODE); - epd.DisplayStringAtLine(2, (uint8_t*)ligne4, CENTER_MODE); - epd.DisplayStringAtLine(1, (uint8_t*)ligne5, CENTER_MODE); + epd.DisplayStringAtLine(5, (uint8_t*)ligne0, CENTER_MODE); + epd.DisplayStringAtLine(4, (uint8_t*)ligne1, CENTER_MODE); + epd.DisplayStringAtLine(3, (uint8_t*)ligne2, CENTER_MODE); + epd.DisplayStringAtLine(2, (uint8_t*)ligne3, CENTER_MODE); + epd.DisplayStringAtLine(1, (uint8_t*)ligne4, CENTER_MODE); + epd.DisplayStringAtLine(0, (uint8_t*)ligne5, CENTER_MODE); epd.RefreshDisplay();