Hello,
I am making a project for school. It will be a robot that will help blind people cross streets. If the robot gets to a curb, it will sense if there is any motion . If none for 5 seconds, it will move across the street. How can I do this? Is there any code I can look at that is similar to what I want to program? I know Java but I don't know C++.
I already have the motion sensor.
How can I make the code so that if there is no motion, the robot will move in a straight line?
Yeah, wow, take a deep breath and analyze the complexities here. PaulS is pointing out very valid but only a handful of possibly countless situations you need to handle.
Break down your task ( learn C++ ), prepare for a long haul, there is more than just learning to program C++ required to complete a project like this. To analyze a busy street you will need multiple tasks running simultaneously with complex signal processing, not to mention everything else. Keep this as a project for when you have enough mileage in the required range of skills.