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: SevenSegmentDisplay USBDevice mbed
Revision 1:252cc1fa8e32, committed 2015-02-25
- Comitter:
- rantistic
- Date:
- Wed Feb 25 10:21:59 2015 +0000
- Parent:
- 0:a2be69659f88
- Commit message:
- updated version so works with new libraries
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 24 10:04:23 2014 +0000
+++ b/main.cpp Wed Feb 25 10:21:59 2015 +0000
@@ -5,9 +5,9 @@
//Virtual serial port over USB
USBSerial serial;
-uint8_t countdown;
-uint8_t startno = 6;
-uint8_t userinputno; // do not initialise scanf values as this creates problems
+int countdown;
+int startno = 6;
+int userinputno; // do not initialise scanf values as this creates problems
SevenSegmentDisplay segmentled( FADE );
Ticker timeout;
@@ -24,19 +24,19 @@
for(countdown=startno; countdown>0; countdown--)
{
segmentled.DisplayInt(countdown);
- serial.printf("%u\n\r", countdown);
+ serial.printf("%d\n\r", countdown);
wait(1);
}
countdown = 0;
segmentled.DisplayInt(countdown);
- serial.printf("%u\n\r", countdown);
+ serial.printf("%d\n\r", countdown);
serial.printf("Hi User! Please enter a number between 2 and 99\n\r");
- serial.scanf("%u", &userinputno);
+ serial.scanf("%d", &userinputno);
segmentled.DisplayInt(userinputno);
- serial.printf("The countdown will now start from %u ... \n\r", userinputno);
+ serial.printf("The countdown will now start from %d ... \n\r", userinputno);
- wait(3);
+ wait(1);
startno = userinputno;
}