test de premier push

Dependencies:   WakeUp mbed EPD_GDE021A1

Committer:
mathieusab
Date:
Sat Nov 12 10:40:51 2016 +0000
Revision:
23:a56c813ac52c
Parent:
22:cbc76ab6a864
Alignement des valeurs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nba 17:3f52db5f8b42 1 #include "mbed.h"
nba 17:3f52db5f8b42 2 #include "EPD_GDE021A1.h"
nba 17:3f52db5f8b42 3 #include "../Headers/refreshScreen.h"
nba 17:3f52db5f8b42 4
nba 17:3f52db5f8b42 5 #define EPD_CS PA_15
nba 17:3f52db5f8b42 6 #define EPD_DC PB_11
nba 17:3f52db5f8b42 7 #define EPD_RESET PB_2
nba 17:3f52db5f8b42 8 #define EPD_BUSY PA_8
nba 17:3f52db5f8b42 9 #define EPD_POWER PB_10
nba 17:3f52db5f8b42 10 #define EPD_SPI_MOSI PB_5
nba 17:3f52db5f8b42 11 #define EPD_SPI_MISO PB_4
nba 17:3f52db5f8b42 12 #define EPD_SPI_SCK PB_3
nba 17:3f52db5f8b42 13
mathieusab 22:cbc76ab6a864 14 #define TAILLE_LIGNE 25
mathieusab 22:cbc76ab6a864 15
nba 17:3f52db5f8b42 16 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
nba 17:3f52db5f8b42 17
nba 17:3f52db5f8b42 18 void refreshScreen()
nba 17:3f52db5f8b42 19 {
mathieusab 22:cbc76ab6a864 20 char ligne0[TAILLE_LIGNE];
mathieusab 22:cbc76ab6a864 21 char ligne1[TAILLE_LIGNE];
mathieusab 22:cbc76ab6a864 22 char ligne2[TAILLE_LIGNE];
mathieusab 22:cbc76ab6a864 23 char ligne3[TAILLE_LIGNE];
mathieusab 22:cbc76ab6a864 24 char ligne4[TAILLE_LIGNE];
mathieusab 22:cbc76ab6a864 25 char ligne5[TAILLE_LIGNE];
nba 17:3f52db5f8b42 26 double poidsRuche;
nba 17:3f52db5f8b42 27 double temperatureRuche;
nba 17:3f52db5f8b42 28 double humiditeRuche;
nba 17:3f52db5f8b42 29
nba 17:3f52db5f8b42 30 poidsRuche = 48.26;
mathieusab 23:a56c813ac52c 31 temperatureRuche = 12.3;
mathieusab 23:a56c813ac52c 32 humiditeRuche = 52.4;
nba 17:3f52db5f8b42 33
mathieusab 23:a56c813ac52c 34 sprintf (ligne0, "Poids = %3.2f Kg", poidsRuche);
mathieusab 23:a56c813ac52c 35 sprintf (ligne1, "Temperature = %2.1f C", temperatureRuche);
mathieusab 23:a56c813ac52c 36 sprintf (ligne2, "Humidite = %2.1f %%", humiditeRuche);
mathieusab 22:cbc76ab6a864 37 sprintf (ligne3, "123456789012345678901234");
mathieusab 22:cbc76ab6a864 38 sprintf (ligne4, "123456789012345678901234");
mathieusab 22:cbc76ab6a864 39 sprintf (ligne5, "123456789012345678901234");
mathieusab 22:cbc76ab6a864 40 /*
mathieusab 22:cbc76ab6a864 41 sprintf (ligne2, "Le poids est de %3f Kg",poidsRuche);
mathieusab 22:cbc76ab6a864 42 sprintf (ligne3, "La temperature est de %3f C",temperatureRuche);
mathieusab 22:cbc76ab6a864 43 sprintf (ligne4, "L'humidite est de %3f %",humiditeRuche);
nba 17:3f52db5f8b42 44 sprintf (ligne5, "on met autre chose");
mathieusab 22:cbc76ab6a864 45 */
nba 17:3f52db5f8b42 46
nba 17:3f52db5f8b42 47 epd.Clear(EPD_COLOR_WHITE);
nba 17:3f52db5f8b42 48
mathieusab 23:a56c813ac52c 49 epd.DisplayStringAtLine(5, (uint8_t*)ligne0, LEFT_MODE);
mathieusab 23:a56c813ac52c 50 epd.DisplayStringAtLine(4, (uint8_t*)ligne1, LEFT_MODE);
mathieusab 23:a56c813ac52c 51 epd.DisplayStringAtLine(3, (uint8_t*)ligne2, LEFT_MODE);
mathieusab 23:a56c813ac52c 52 epd.DisplayStringAtLine(2, (uint8_t*)ligne3, LEFT_MODE);
mathieusab 23:a56c813ac52c 53 epd.DisplayStringAtLine(1, (uint8_t*)ligne4, LEFT_MODE);
mathieusab 23:a56c813ac52c 54 epd.DisplayStringAtLine(0, (uint8_t*)ligne5, LEFT_MODE);
nba 17:3f52db5f8b42 55
nba 17:3f52db5f8b42 56
nba 17:3f52db5f8b42 57 epd.RefreshDisplay();
nba 17:3f52db5f8b42 58
nba 17:3f52db5f8b42 59 }