Works! (forgot essential piece of code). Softserial communication from another device will trigger commands
This commit is contained in:
parent
0c02830da8
commit
2a40957636
|
@ -87,7 +87,7 @@ void setup() {
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
timer = millis();
|
timer = millis();
|
||||||
|
|
||||||
if (Serial.available()) {
|
if (Serial.available()) {
|
||||||
cmdChar = (char)Serial.read();
|
cmdChar = (char)Serial.read();
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,10 @@ void loop() {
|
||||||
cmdChar = (char)softSerial.read();
|
cmdChar = (char)softSerial.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmdChar != 'z') {
|
||||||
|
cmd(cmdChar);
|
||||||
|
}
|
||||||
|
|
||||||
cmdChar = 'z';
|
cmdChar = 'z';
|
||||||
|
|
||||||
btn(Fmotor);
|
btn(Fmotor);
|
||||||
|
|
Loading…
Reference in New Issue