0
I need a description of what he does.
if( ! digitalRead(sensor1)) {
speed1 = frente;
speedv1=0;
} else {
speed1 = 0;
speedv1 = voltar;
}
0
I need a description of what he does.
if( ! digitalRead(sensor1)) {
speed1 = frente;
speedv1=0;
} else {
speed1 = 0;
speedv1 = voltar;
}
2
The ideal would be to see the context, but reading it you can say:
digitalRead()
passing as argument the value of the variable sensor1
. What she does we have no way of knowing.else
shall be executed. The if
is a decision command.speed1
to validate the value that is in the variable frente
at this point in time and the variable speedv1
becomes 0.speed1
will be worth 0 and speedv1
will be worth the same as voltar
at this time.0
If the sensor reading returns any information it arrow the variable speed1 with "front" and speedv1 with 0 if nothing returns, the variable speedv1 gets the value "back" and speed1 also with 0 "Zero".
Browser other questions tagged c arduino
You are not signed in. Login or sign up in order to post.
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero