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.
Diff: main.cpp
- Revision:
- 21:4d6b26eecdac
- Parent:
- 18:452b5da21cfd
- Child:
- 23:0b6901c9302c
--- a/main.cpp Fri Jul 19 21:25:24 2013 +0000 +++ b/main.cpp Sat Jul 20 16:20:14 2013 +0000 @@ -106,11 +106,14 @@ break; } - else if(recv == 8) //backspace is pressed, delete one character both on screen and line buffer + else if(recv == 8 || recv == 127) //backspace is pressed, delete one character both on screen and line buffer { - pc.putc(8); - pc.putc(32); - pc.putc(8); + if(line_length > 0) //delete one char on screen + { + pc.putc(8); + pc.putc(32); + pc.putc(8); + } if(line_length <= 3 && line_length>=1) { @@ -120,7 +123,7 @@ if(line_length > 0) line_length --; } - else //other character is pressed, record that in line buffer + else if(recv == '.' || recv == '-' || (recv >= '0' && recv <= '9') ) //the line buffer accepts -, ., 0-9 only { pc.putc(recv); line_length ++;