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.
Fork of Serial_HelloWorld_Mbed by
Revision 5:1ba2b0e9e582, committed 2015-07-14
- Comitter:
- philipgoosen
- Date:
- Tue Jul 14 14:14:58 2015 +0000
- Parent:
- 4:178b04ae427e
- Child:
- 6:da101b92bc2d
- Commit message:
- Added letter check function
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jul 14 13:11:30 2015 +0000
+++ b/main.cpp Tue Jul 14 14:14:58 2015 +0000
@@ -1,4 +1,5 @@
#include "mbed.h"
+// Data parser by Philip Goosen
/*#define TX USBTX
#define RX USBRX*/
@@ -21,6 +22,14 @@
}
}
+int isLetter(char let) // Only works for upper case
+{
+ if (let >= 'A' or let <= 'Z')
+ {
+ return 1;
+ }
+}
+
int toDigit(char c)
{
return (c - '0');
@@ -47,7 +56,7 @@
char c = pc.getc();// Gets a character from the computer that should be a digit from 0 - 9
- if (checkDigit(c))
+ if (check Digit(c))
{
int count = toDigit(c);
int x = 0;
