Hello,
On my code in Arduino Uno, i have written a function of different behavior of lights. But it does not blink how its supposed to do. I mean, it blinks, and then starts to move. But I need it to blink while moving!
E.g,
If arduino steers right, blink blue.
Function to blink:
void blinkBlue()
{
digitalWrite(blue,HIGH);
delay(50);
digitalWrite(blue,LOW);
delay(50);
}
I have tried to insert function into function (if steers right), but same thing happens.
Function to steer right
void right(int time)
{
//blinkBlue();
digitalWrite(Right_motor_go,LOW);
digitalWrite(Right_motor_back,LOW);
analogWrite(Right_motor_go,0);
analogWrite(Right_motor_back,0);
digitalWrite(Left_motor_go,HIGH);
digitalWrite(Left_motor_back,LOW);
analogWrite(Left_motor_go,200);
analogWrite(Left_motor_back,0);
delay(time * 100);
}
And the loop would be
void loop()
{
delay(2000);
blinkBlue();
right(10);
}
Any tip would be appreciated.