Hello Guys
I wrote in this forum because i m new to arduino programming and i need help.
So my project uses the parts in the BYOR kit,so to specify i am using a motor, witch connects with 2 cables ,and the ultrasonic sensor.i am going to post also the image of my current cable configuration and the code that i scrapped from a project of the BYOR.My plan consist on moving the motor (after a 5 second) when the ultrasonic sensor scans an object witch is in between a certain distance (about 10cm).
I tried to modify the code and i tested it on my prototype but the motor just spins and dosnt care of what the sensor says.During my testing i saw that if i programmed that the distance needed to make the motor spins was miner than 10cm it would start but the motor spins constantly.I lowered the value till 0 so he stopped but only at 0...Please help me..
Thanks, actually i knew that the else part was wrong, i uploaded the wrong version, but today I am going to test and let you know if it works or not with your corrections! Thanks