program 4 code
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
Diff: main.cpp
- Revision:
- 3:c8f1a16767f2
- Parent:
- 2:2cfdd07ab939
- Child:
- 4:60bddeca288c
--- a/main.cpp Mon Nov 30 01:34:54 2020 +0000 +++ b/main.cpp Mon Nov 30 13:57:16 2020 +0000 @@ -26,14 +26,14 @@ led1 = 1; uint32_t count=getMax(); - + int16_t freq=GetFreqAt(2); uint32_t totalFreq=0; BSP_LCD_SetFont(&Font20); lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"MBED EXAMPLE", CENTER_MODE); wait(1); - //sprintf((char*)text, "count=%d", count); - //lcd.DisplayStringAt(1, LINE(1), (uint8_t *)&text, LEFT_MODE); + sprintf((char*)text, "freq=%d", freq); + lcd.DisplayStringAt(1, LINE(1), (uint8_t *)&text, LEFT_MODE); while(1) { @@ -47,8 +47,10 @@ uint32_t word=0; uint32_t wordFreq=0; float freq= wordFreq/totalFreq; - sprintf((char*)text, "count=%d", count); - lcd.DisplayStringAt(i, LINE(i), (uint8_t *)&text, LEFT_MODE); + sprintf((char*)text, "freq=%d", freq); + lcd.DisplayStringAt(1, LINE(1), (uint8_t *)&text, LEFT_MODE); + //sprintf((char*)text, "count=%d", count); + //lcd.DisplayStringAt(i, LINE(i), (uint8_t *)&text, LEFT_MODE); uint16_t h=i*20; lcd.DrawRect(Xpos, 200, 20, h);