Well im not on a real project...
Im a school and in our current project we just can't do a finish project.
If i come here it's to ask for some help about the code...
The simulation, the circuit...
All are here to show you how the system work.
But i need that someone see what make the system not working correctly about the code.
About the sensor...
I'll be clear, in reality it's an IR sensor and it detect if something is in the area that the sensor can detect.
And in the system in 3D...
The sensor will detect the red pillar and make a signal that can stop the motor rotating...
And the red pillar are placed to make the perfect 90° rotation.
No matter how far the sensor can detect, i just need it to detect and it will not affecte the code because the 3D models are only here to show how the machine works...
Just try to think that the sensor code it's in origin a code that worked for an IR sensor and in Tinkercad only ( i think) the PIR models work similar to an regular Ir sensor...
Just please, i would like to get some help about the code...