Code does not execute
omarmonzer
Posts: 6
in Propeller 1
I am using making some sort of obstacle avoiding robot using ultrasonic sensors. It worked well until I added a function to the code. Then, it did not even start. The function is not called at the beginning of the code and it compiles successfully.
The weirdest thing is that I deleted the content of another function and found that the code started to run.
The weirdest thing is that I deleted the content of another function and found that the code started to run.
Comments
I also think it is a memory problem but the code compiles with no error messages.
Here is the code size.
You can always compile and download a simple known working program (led blinker, hello world, etc.) to eliminate the PC, PC to Prop connection, and Propeller chip.
http://forums.parallax.com/discussion/167218/botto-a-walking-robot-with-3d-printed-parts-and-controlled-by-parallax-propeller-activity-board
It turned out that, when I tried to clean up my code and remove debugging stuff, I was asking the sensor for updates too fast.
You need to wait some time between asking the sensor for an update or it doesn't work and the driver stalls...
I am using SimpleIDE.
I tried a working program and it worked well.
OK, so the problem is with the downloaded code. What I often do for this kind of debugging is to add a line at the beginning of each section and subroutine that outputs "Got to sub" to PST, where sub is the name of the section or subroutine.