hi
ik have a tricky question, cant get my arduino to understand the code i send to it
here is (a part of) my script:
void serieel(){
if (Serial.available() > 0) {
char incoming[4] ;
while(Serial.available() < 4) {
;
}
for (int i=0; i < 4; i++) {
incoming[i] = Serial.read();
}
if (incoming == "9130"){ w13 = 0 ;}
if (incoming == "9131"){ w13 = 1 ;}
if (incoming == "5010"){ sb1 = 0 ;}
if (incoming == "5011"){ sb1 = 1 ;}
if (incoming == "5020"){ sb2 = 0 ;}
if (incoming == "5021"){ sb2 = 1 ;}
if (incoming == "5030"){ sb3 = 0 ;}
if (incoming == "5031"){ sb3 = 1 ;}
}
}
if i type the numbers in the serial monitor i can return them on the screen with Serial.print(incoming) but i can’t use the numbers to change the variables…
do you guys have any idia’s??
greetz