1
0
Fork 0

Simpler serial read

With chars instead of strings.
This commit is contained in:
J. Elfring (p) 2019-09-02 12:22:25 +02:00
parent d9814ec1a2
commit ba628fc65b

View file

@ -41,14 +41,15 @@ void setup() {
void loop() {
// SERIAL
while (Serial.available()) {
String rcv_sr = Serial.readString();
while ( Serial.available() > 0 ) {
int rcv_sr = Serial.read();
// Send data to serial port
Serial.println("RX serial: " + rcv_sr);
Serial.print("RX serial: ");
Serial.println(rcv_sr, DEC);
// Switch LEDs
switch (rcv_sr[0]) {
switch (rcv_sr) {
case 'g' :
led_allOff();
led_greenLine();