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 6:f8865b6d592a, committed 2015-05-28
- Comitter:
- MaxScorda
- Date:
- Thu May 28 14:52:30 2015 +0000
- Parent:
- 5:4d547f4c1278
- Child:
- 7:f57abb3f0d3f
- Commit message:
- Pre Parser
Changed in this revision
--- a/IOFuncLib.lib Sun May 24 18:38:44 2015 +0000 +++ b/IOFuncLib.lib Thu May 28 14:52:30 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/MaxScorda/code/IOFuncLib/#58f3784ad68e +http://developer.mbed.org/users/MaxScorda/code/IOFuncLib/#8e723d99838e
--- a/config.h Sun May 24 18:38:44 2015 +0000 +++ b/config.h Thu May 28 14:52:30 2015 +0000 @@ -1,14 +1,16 @@ #ifndef SIO_CONFIG_H #define SIO_CONFIG_H -#define SERIAL1BAUD 9600 // set BAUD 1 +#define SERIAL1BAUD 230400 // set BAUD 1 #define SERIALARDBAUD 9600 // set ARDUINO BAUD 2 - +#define screenRow 24 +#define screenColumn 80 const int test_length = 20; const float test_right[test_length] = {0.2, 0.0, 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.6, 0.0, 0.0, 0.0, 0.8, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}; -#endif \ No newline at end of file +#endif +
--- a/main.cpp Sun May 24 18:38:44 2015 +0000 +++ b/main.cpp Thu May 28 14:52:30 2015 +0000 @@ -35,21 +35,27 @@ //la funzione strcmp fa parte della libreria string standard del C e confronta 2 stringhe //restituendo 0 se le stringhe sono uguali. if ((strcmp(stringa,"on")==0) ||(strcmp(stringa,"acceso")==0) ||(strcmp(stringa,"apriti sesamo")==0)) { - pc.printf("Led ACCESO \n\r"); + // pc.printf("Led ACCESO \n\r"); + sc.writeScreen("Led ACCESO \n",2,10); ardser.printf("\nLed ACCESO \n\r"); led.onOff(1); //Accende il led errp=0; + sc.commitScreen(); } //Confronto per i comandi di spegnimento del led if ((strcmp(stringa,"off")==0) ||(strcmp(stringa,"spento")==0) ||(strcmp(stringa,"chiuditi sesamo")==0)) { - pc.printf("Led SPENTO !\n\r"); + // pc.printf("Led SPENTO !\n\r"); + sc.writeScreen("Led SPENTO! \n",2,10); ardser.printf("\nLed SPENTO! \n\r"); led.onOff(0); // spegne il led errp=0; + sc.commitScreen(); } if (errp==1) { - pc.printf("Bad command\n\r"); + // pc.printf("Bad command\n\r"); + sc.writeScreen("Bad Command\n",2,10); ardser.printf("\nBad command\n\r"); + sc.commitScreen(); } } //-------------- fine funzioni @@ -65,6 +71,7 @@ //pc.format(int bits=8, Parity parity=SerialBase::None, int stop_bits=1) mybutton.fall(&pressed); + sc.emptyFrame(); sc.banner(); while(1) { @@ -78,8 +85,10 @@ pc.printf("\n\r"); buffer[i]=0; //se è un CR inserisci un carattere nullo nel buffer per delimitare la stringa i=0; //azzera la posizione del puntatore del buffer pronto per la ricezione di una nuova stringa - ardser.printf("\nxx\n\r"); + ardser.printf("\ncmd Ready\n\r"); parser(buffer); } } } + +