Console Serial IO con display OLED e seriale asincrona

Dependencies:   mbed BufferedSerial AserialIOFuncLib SSD1306 TerminalPlusV2

Fork of SerialIO by Max Scordamaglia

Console Serial IO con display OLED e seriale asincrona

Files at this revision

API Documentation at this revision

Comitter:
MaxScorda
Date:
Sun Aug 16 23:20:44 2015 +0000
Parent:
12:78f6112c900f
Child:
14:d27e769c7bee
Commit message:
1ok

Changed in this revision

Functions.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Functions.h	Sun Aug 16 23:14:03 2015 +0000
+++ b/Functions.h	Sun Aug 16 23:20:44 2015 +0000
@@ -32,13 +32,14 @@
     sc.writeScreen(fnzAdd.string2char(strIn),2,20,20);
     //sc.writeScreen((char*)func.c_str() ,02,07); funziona anche cosi'
 
-   //led
+    //led
     if (func=="l") {
         if (funcnum=="1") {
             if (param=="on ") {
                 sc.writeScreen("ON \n",2,14,3);
                 sc.writeScreen("Led ACCESO \n",42,20,99);
                 ardser.printf("\nLed ACCESO \n\r");
+                printDisp(0,"Led ACCESO \n\r");
                 led.onOff(1); //Accende il led
                 errp=0;
             }
@@ -46,6 +47,7 @@
                 sc.writeScreen("OFF \n",2,14);
                 sc.writeScreen("Led SPENTO! \n",42,20,99);
                 ardser.printf("\nLed SPENTO! \n\r");
+                printDisp(0,"Led SPENTO \n\r");
                 led.onOff(0); //Spegne il led
                 errp=0;
             }
@@ -68,7 +70,7 @@
             }
         }
     }
-    
+
     //command SYNTH
     if ((func>="1") && (func<="9")) {
         if ((funcnum>="1") && (funcnum<="9")) {
@@ -77,8 +79,8 @@
             ardser.printf(fnzAdd.string2char(fnzAdd.addEOS(func+funcnum+param)));
             //ardser.printf(fnzAdd.string2char(fnzAdd.addEOS(func+"-"+funcnum+"-"+param)));
             errp=0;
-            }
         }
+    }
 
     // comando fuori parsing
     if (errp==1) {
@@ -86,7 +88,7 @@
         sc.writeScreen("Bad Command\n",42,20,99);
         ardser.printf("\nBad command\n\r");
     }
-     sc.commitScreen();
+    sc.commitScreen();
 }
 
 
--- a/main.cpp	Sun Aug 16 23:14:03 2015 +0000
+++ b/main.cpp	Sun Aug 16 23:20:44 2015 +0000
@@ -15,6 +15,7 @@
 genFunctions fnz;
 
 //var
+int cont=0;
 int dispType=0; //0:oled  1:lcd
 
 //------------ Funzioni -------------
@@ -33,7 +34,10 @@
 
     mybutton.fall(&pressed);
     sc.emptyFrame();
-    sc.banner();
+    sc.banner();    
+    // display
+    initDisp(dispType);
+    setFontDisp(dispType,'N');
 
     while(1) {
         ardser.attach(&callback);