йцв
Dependencies: EPD_GDE021A1 mbed
Fork of DISCO-L053C8_ePD_demo by
Diff: main.cpp
- Revision:
- 2:71b5f9a738f9
- Parent:
- 1:842cd88170e2
--- a/main.cpp Thu Jun 01 15:20:03 2017 +0000 +++ b/main.cpp Thu Jun 01 15:42:18 2017 +0000 @@ -13,7 +13,8 @@ EPD_GDE021A1 epd(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY, EPD_POWER, EPD_SPI_MOSI, EPD_SPI_MISO, EPD_SPI_SCK); DigitalOut led1(LED1); -AnalogIn temperature(A0); +AnalogIn temperature(ADC_TEMP); +AnalogIn vref(ADC_VREF); //width 48 //height 26 static uint8_t Battery_img[] = { @@ -49,6 +50,7 @@ { led1 = 1; char tmpTemp[15] = "test"; + char string1[15]; epd.SetFont(&Font20); epd.Clear(EPD_COLOR_WHITE); // epd.DisplayStringAtLine(5, (uint8_t*)"HUEMBED", CENTER_MODE); @@ -62,10 +64,11 @@ led1 = !led1; epd.Clear(EPD_COLOR_WHITE); - sprintf(tmpTemp, "P = %.1f", temperature.read()); + sprintf(tmpTemp, "P = %.1f", vref); + sprintf(string1, "IDLE %.1fV", vref.read()); epd.DisplayStringAtLine(0, (uint8_t*)tmpTemp, LEFT_MODE); epd.DisplayStringAtLine(1, (uint8_t*)"0.5 1.0", LEFT_MODE); - epd.DisplayStringAtLine(2, (uint8_t*)"IDLE", LEFT_MODE); + epd.DisplayStringAtLine(2, (uint8_t*)string1, LEFT_MODE); //epd.DrawImage(130, 0, 48, 26, Battery_img); //epd.DisplayChar(1, 3, (uint8_t*)"HUEMBED"); epd.RefreshDisplay();