Use ir sensors to detect an object which would be the car. So 2 sensors and 4leds
Use ir sensors to detect an object which would be the car. So 2 sensors and 4leds
Sounds about right to me, very simple and effective
Sent from my iPhone
Do you have any ideas whether to use an array, or switch case, or else/if??
Fairly easy to use a simple state machine and a switch - case, if it where longer I would look at it differently but this is a pretty short and simple thing
But if you wanted to put out a little more effort into it you could have car objects with member functions such as look_left(), look_right(), check_intersection(). Then you could set up the instantiations with their own theads. You could then use tick-time to model slow-pokes and hotheads. That would be interesting. . .
Let me suggest you consider hall-effect sensing rather than optical interruption here. It could be both more reliable and unobtrusive, maybe. Probably easier to implement. Perhaps you could glue PMs to the bottom of your model cars.
Though, maybe you could glue a mirror to the bottom of a car just as easily. . .
This is juicy. Please elaborate a little more upon your application, SVP.
Did you figure it out yet?