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
Fork of Lab_6_WaG by
Diff: main.cpp
- Revision:
- 13:8936b2f64aa2
- Parent:
- 11:6751b9406142
- Child:
- 14:be27f6e21a8a
--- a/main.cpp Tue Feb 27 14:22:49 2018 +0000
+++ b/main.cpp Tue Feb 27 16:16:04 2018 +0000
@@ -33,7 +33,15 @@
//char command_text[10] = "0x0";
while(1) {
pc.printf("Select a digit between 0 and 9999:\n");
- int check = scanf("%d", &input);
+ scanf("%d", &input);
+
+ /*
+ char cur_char = getchar();
+ while (cur_char < 48 or cur_char > 57) { //ask for input until 0-9 is selected
+ pc.printf("Select a digit between 0 and 9:\n");
+ cur_char = getchar();
+ }
+ */
while (input < 0 or input > 9999) { //ask for input until 0-9999 is selected
pc.printf("You entered a number out of range\n");
@@ -44,9 +52,11 @@
printf("you entered: %d\n", input);
bin2bcd_array(input, bcd);
+ /*
for (int i = 0; i < 4; i++) {
pc.printf("bcd: %d\n", bcd[i]);
}
+ */
send_command_to_display(bcd);
}
