I’m trying to create the front lights to act as a turn signal. Basically, they go from red and green on their own, and not correlating when you rotate the robot. I called, they suggested posting here.
Cool. Could I suggest a small variation?
I was experimenting a bit, and found that its not too hard to make the lights flash like a turn signal. It might be fun to try that instead of the colors. You would be able to make only the left or right blink, and I’m sure there is a way to make it not blink at all then it’s going straight.
I want right to change to green when making a right turn (0-90)
And left to turn green to make a left turn (270-359)
What is your suggestion for a small variation?
Can I get a sample code, I’m getting no where with coding with this turning and a different coding issue with the color sensor.
One alteration I would make is that a right turn will be a negative yaw and a left turn will be a positive yaw. Here is a sample code that I have that flashes the lights red or green as the RVR is turning one direction or another
Let me know how this works for you!!
I was also looking for a way to make turn signals, and I found this code; thanks!
Can someone explain why the delay for 1s is needed outside the forever loop for this to work?
From what I can see in the code, the delay doesn’t have a real function except to slow things down.