Could it be that somehow this tight loop eliminates the ability to react to the front SONAR. The video shows the car stuck against the wall in total silence with the front LED constantly on. This WHILE loop could cause that if somehow the two drive motor instructions were being short changed. Maybe I need a PAUSE in here. It would do no harm.
Code:keepreversing: WHILE rangefront < stopreversing ' We have not reversed far enough HIGH stopgo 'go LOW forrev 'back GOSUB triggers WEND




Bookmarks