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: C12832_lcd iSerial mbed
Revision 0:8d267ff223f0, committed 2016-04-19
- Comitter:
- 40125682
- Date:
- Tue Apr 19 21:38:28 2016 +0000
- Commit message:
- Serial port reader;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832_lcd.lib Tue Apr 19 21:38:28 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/dreschpe/code/C12832_lcd/#8f86576007d6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iSerial.lib Tue Apr 19 21:38:28 2016 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/ykuroda/code/iSerial/#20759f992d48
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 19 21:38:28 2016 +0000
@@ -0,0 +1,57 @@
+#include "mbed.h"
+#include "C12832_lcd.h"
+#include "stdio.h"
+#include "string.h"
+#include "stdint.h"
+#include "stdlib.h"
+#include "time.h"
+
+C12832_LCD lcd; 
+Serial pc(USBTX, USBRX);
+
+char testStringBuffer[150];
+ 
+#define NUM_FIELDS  (12) 
+char* pFields[NUM_FIELDS];
+ 
+void ParseFields(char* inputBuffer, char** pFields, uint32_t numFields, char* delimiterChars)
+{
+    char* pString = inputBuffer;
+    char* pField;
+    
+    for(uint32_t i=0; i<numFields; i++)
+    {
+        pField = strtok(pString, delimiterChars);
+ 
+        if(pField != NULL)
+        {
+            pFields[i] = pField;
+        }
+        else
+        {
+            pFields[i] = "";
+        }
+ 
+        pString = NULL; 
+    }
+}
+
+int main(int argc, char* argv[])
+{
+    pc.baud(4800);
+    
+    while(1)
+    {
+        pc.scanf("&s", &testStringBuffer);
+        ParseFields(testStringBuffer, pFields, NUM_FIELDS, ",");
+        lcd.cls();
+        lcd.locate (0,0);
+        lcd.printf("%s", pFields[1]);
+    }
+
+    return 0;
+}
+ 
+
+    
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 19 21:38:28 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f \ No newline at end of file