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: mbed
Revision 3:916c3a72cbd0, committed 2022-11-07
- Comitter:
- alexander0707
- Date:
- Mon Nov 07 11:17:15 2022 +0000
- Parent:
- 2:063b68bbc135
- Commit message:
- v03;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Nov 07 09:05:06 2022 +0000 +++ b/main.cpp Mon Nov 07 11:17:15 2022 +0000 @@ -104,14 +104,16 @@ //... } if(bS1Timer == nTastLong){ /* Taste "lange gedrückt" erkannt */ - bIdx--; + if(bIdx <= 0x0f || bIdx > 0x01) bIdx--; + else bIdx = 0x0f; } bS1Timer++; } } else{ /* Taste nicht gedrückt */ if((bS1Timer >= nTastShort) && (bS1Timer <= nTastLong)){ /* Taste wurde bereits erkannt */ - bIdx++; + if(bIdx < 0x0f || bIdx >= 0x01) bIdx++; + else bIdx = 0x01; } bS1Timer = 0; } @@ -191,7 +193,7 @@ bLedShield = 0x00; while(1){ vCheckTasten(); - wSerial = abZiffer[bIdx & 0x0f]<<8 | bDigit ; /* 7-Segmentziffer bestimmen */ + wSerial = abZiffer[bIdx]<<8 | bDigit ; /* 7-Segmentziffer bestimmen */ vShiftLoad(wSerial); /* Segmente verschieben und Digit festlegen */ bLedShield = abBargraph[bBargraph & 0x03]; /* Bargraph bestimmen */ wait_us(10000);