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: lib.cpp
- Revision:
- 9:48e93bcd1d5c
- Parent:
- 8:9b41712fd2c3
- Child:
- 10:c3556e27e576
diff -r 9b41712fd2c3 -r 48e93bcd1d5c lib.cpp
--- a/lib.cpp Mon Apr 25 01:18:04 2016 +0000
+++ b/lib.cpp Mon Apr 25 01:39:32 2016 +0000
@@ -193,3 +193,12 @@
lcd->text_height(4);
lcd->text_string(text, 1, 4, FONT_7X8, BLUE);
}
+
+int id_to_int(char *user_id, int size)
+{
+ int val = 0;
+ for (int i = 0; i < size; i++) {
+ val += 10 * val + (user_id[i] - '0');
+ }
+ return val;
+}