// for all GEVINO // Read and setup Parameter // Read ad Set command // Install Android app https://github.com/leandher/mobtooth-controller/blob/master/src/app/app.component.ts // https://github.com/leandher/mobtooth-controller // Load setup config mobtooth.cfg on the app. // // Written by Giorgio Evangelista 22/07/2019 void setup() { Serial.begin(9600); SerialUSB.begin(115200); Serial.setTimeout(100); } char tmp; String SerialString = ""; int Var; void loop() { if( SerialUSB.available()){ tmp = SerialUSB.read(); Serial.write(tmp); } if (Serial.available()) { SerialString = Serial.readString(); SerialUSB.println(SerialString.c_str()); if ( !strncmp( SerialString.c_str(),"A",1)) { Serial.print("11"); Serial.print("o"); SerialUSB.println("Ok "); } if ( !strncmp( SerialString.c_str(),"B",1)) { Serial.print("22"); Serial.print("o"); SerialUSB.println("Ok "); } if ( !strncmp( SerialString.c_str(),"Uno",3)) { Var = atoi( SerialString.c_str() + 3 ); SerialUSB.println(""); SerialUSB.print("Uno = "); SerialUSB.println(Var); } if ( !strncmp( SerialString.c_str(),"Due",3)) { Var = atoi( SerialString.c_str() + 3 ); SerialUSB.println(""); SerialUSB.print("Due = "); SerialUSB.println(Var); } // EEPROM.write(1, (uint8_t)highByte(SerialNumber)); //write the first half // EEPROM.write(0, (uint8_t)lowByte(SerialNumber)); //write the second half // EEPROM.commit(); } }