Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Revision 5:195fe765ac32, committed 2020-12-07
- Comitter:
- mcharrison17
- Date:
- Mon Dec 07 22:25:34 2020 +0000
- Parent:
- 4:febba9dd921b
- Commit message:
- For loop;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r febba9dd921b -r 195fe765ac32 main.cpp --- a/main.cpp Mon Dec 07 22:23:20 2020 +0000 +++ b/main.cpp Mon Dec 07 22:25:34 2020 +0000 @@ -64,7 +64,7 @@ uint8_t *word; - int16_t wordfrequency; + int16_t wordfrequency = 0; float prct; int32_t MAX; int32_t totalfrequency; @@ -81,10 +81,6 @@ sprintf((char*)text, "percent=%f", prct); lcd.DisplayStringAt(0, LINE(2), (uint8_t *)&text, LEFT_MODE);*/ int num = 2; - - wordfrequency = GetFreqAt(2); - sprintf((char*)text, "wordfreq=%d", wordfrequency); - lcd.DisplayStringAt(0, LINE(num), (uint8_t *)&text, LEFT_MODE); while(1) { @@ -92,12 +88,13 @@ for(int32_t i = 1; i < MAX; i++){ word = GetWordAt(i); wordfrequency = GetFreqAt(i); - /*sprintf((char*)text, "wordfreq=%d", wordfrequency); + sprintf((char*)text, "wordfreq=%d", wordfrequency); lcd.DisplayStringAt(0, LINE(num), (uint8_t *)&text, LEFT_MODE); - prct = ((wordfrequency)/((float)totalfrequency));*/ + prct = ((wordfrequency)/((float)totalfrequency)); /*sprintf((char*)text, "percent=%f", prct); lcd.DisplayStringAt(0, LINE(num), (uint8_t *)&text, LEFT_MODE);*/ prct = 0; + wordfrequency = 0; num = num + 2; } wait(1);