Console Serial IO con display OLED e seriale asincrona
Dependencies: mbed BufferedSerial AserialIOFuncLib SSD1306 TerminalPlusV2
Fork of SerialIO by
Console Serial IO con display OLED e seriale asincrona
Revision 35:e9e9d518c354, committed 2015-09-26
- Comitter:
- MaxScorda
- Date:
- Sat Sep 26 01:02:23 2015 +0000
- Parent:
- 34:9f52d82995ea
- Child:
- 36:9ecb98d7c2cd
- Commit message:
- Ridisegnata interfaccia per nuova console progetto Glass
Changed in this revision
Functions.h | Show annotated file Show diff for this revision Revisions of this file |
TerminalPlus.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/Functions.h Fri Sep 25 00:18:01 2015 +0000 +++ b/Functions.h Sat Sep 26 01:02:23 2015 +0000 @@ -31,11 +31,11 @@ funcnum=strIn.substr(1,1); param=strIn.substr(2,3); //write param - term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(func)),11,4,10,1); - term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(funcnum)),39,4,10,1); - term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(param)),61,4,10,1); + term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(func)),11,4,10,1); //p01 + term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(funcnum)),39,4,10,1); //p02 + term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(param)),61,4,10,1); //p03 //write input string - term.formatPrintf(fnzAdd.string2char(strIn),21,10,10,1); + term.formatPrintf(fnzAdd.string2char(strIn),21,14,10,1); //p51 //term.formatPrintf(((char*)func.c_str() ,02,07); funziona anche cosi' //extra serial output (output reale su arduino default true) @@ -43,68 +43,47 @@ if (funcnum=="s") { if (param=="on ") { realExtraSerial=true; - term.formatPrintf("ON \n",62,8,3,1); - term.formatPrintf("RS Attiva \n",61,10,99,1); + term.formatPrintf("ON \n",62,10,3,1); //p31 + term.formatPrintf("RS Attiva \n",61,14,99,1); //p52 printDisp(dispType,"RS Attiva \n\r"); errp=0; } if (param=="off") { realExtraSerial=false; - term.formatPrintf("OFF\n",62,8,3,1); - term.formatPrintf("RS Disattivata \n",61,10,99); + term.formatPrintf("OFF\n",62,10,3,1); //p31 + term.formatPrintf("RS Disattivata \n",61,14,99); //p52 if (realExtraSerial==false) ardser.printf("\nRS OFF \n\r"); printDisp(dispType,"RS Disattivata \n\r"); errp=0; } } } - - //led - if (func=="l") { - if (funcnum=="1") { - if (param=="on ") { - term.formatPrintf("ON \n",21,6,3); - term.formatPrintf("Led ACCESO \n",61,10,99,1); - if (realExtraSerial==false) ardser.printf("\nLed ACCESO \n\r"); - printDisp(dispType,"Led ACCESO \n\r"); - led.onOff(1); //Accende il led - errp=0; - } - if (param=="off") { - term.formatPrintf("OFF \n",21,6,3); - term.formatPrintf("Led SPENTO! \n",61,10,99); - if (realExtraSerial==false) ardser.printf("\nLed SPENTO! \n\r"); - printDisp(dispType,"Led SPENTO \n\r"); - led.onOff(0); //Spegne il led - errp=0; + + //led for test + if (func=="l") { + if (funcnum=="1") { + if (param=="on ") { + term.formatPrintf("Led ACCESO \n",61,14,99,1); //p52 + if (realExtraSerial==false) ardser.printf("\nLed ACCESO \n\r"); + printDisp(dispType,"Led ACCESO \n\r"); + led.onOff(1); //Accende il led + errp=0; + } + if (param=="off") { + term.formatPrintf("Led SPENTO! \n",61,14,99); //p52 + if (realExtraSerial==false) ardser.printf("\nLed SPENTO! \n\r"); + printDisp(dispType,"Led SPENTO \n\r"); + led.onOff(0); //Spegne il led + errp=0; + } } } - } - //virtual - if (func=="v") { - if (funcnum=="1") { - if (param=="on ") { - term.formatPrintf("ON \n",61,6,3); - term.formatPrintf("Virtual ACCESO \n",61,10,99); - if (realExtraSerial==false) ardser.printf("Virtual On\r"); - printDisp(dispType,"Virtual ACCESO \n\r"); - errp=0; - } - if (param=="off") { - term.formatPrintf("OFF \n",61,6); - term.formatPrintf("Virtual SPENTO! \n",61,10,99); - if (realExtraSerial==false) ardser.printf("Virtual Off\r"); - printDisp(dispType,"Virtual SPENTO \n\r"); - errp=0; - } - } - } - + //command SYNTH if (((func>="0") && (func<="9")) || (func=="n")) { if ((funcnum>="0") && (funcnum<="9")) { - term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(func+"-"+funcnum+"-"+param)),61,10,4,1); - term.formatPrintf("Arduino Command \n",21,8,5,1); + term.formatPrintf(fnzAdd.string2char(fnzAdd.addEOS(func+"-"+funcnum+"-"+param)),21,14,8,1); //p51 + term.formatPrintf("Arduino Command \n",61,14,10,1); //p52 ardser.printf(fnzAdd.string2char(fnzAdd.addEOS(func+funcnum+param+"\r"))); printDisp(dispType,"Arduino Command \n\r"); printDisp(dispType,fnzAdd.string2char(fnzAdd.addEOS(" "+func+funcnum+param+"\r"))); @@ -115,9 +94,8 @@ // comando fuori parsing if (errp==1) { - // pc.printf("Bad command\n\r"); term.forgcol(1); - term.formatPrintf("Bad Command\n",21,8,5); + term.formatPrintf("Bad Command\n",61,14,10,1); //p52 term.forgcol(9); if (realExtraSerial==false) ardser.printf("Bad command\n\r"); printDisp(dispType,"** Bad command ** \n\r"); @@ -145,7 +123,7 @@ printDisp(dispType,"Button pressed\n\r"); term.readypos(); led.flash(4); - } +}
--- a/TerminalPlus.lib Fri Sep 25 00:18:01 2015 +0000 +++ b/TerminalPlus.lib Sat Sep 26 01:02:23 2015 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/MaxScorda/code/TerminalPlus/#82803dacf475 +https://developer.mbed.org/users/MaxScorda/code/TerminalPlus/#60b9f0462d03