Let's Make Robots!

The "Start Here" robot Part II....code error?

While browsing the web pages associated with the "How to build your first robot",  I went to the "Part 2" page,  and copy and pasted the Clean_Navigation.bas file into PICAxe Programming Editor (version 5.2.0),  and when I click the "Simulate" menu item,  I get the following error.

Compile Error: GOSUB AFTERTURN      Error:  Only 16 GOSUB commands allowed !

This error occurs at Line 163....

Can someone tell me what I'm doing wrong?

And a warm "Hello" to all......as this is my first post.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Nigma's picture

Wait, so the code wouldn't work in a small-capacity chip even though you'd have enough bytes available!?

 ...you're kidding me?

OddBot's picture
Look in manual2 under the gosub command. Different picaxes are capable of different numbers of gosub routines and have different stack sizes.
fritsl's picture
.. and sometimes you can set the chip in either 256 or 16 * gosub-mode..
OddBot's picture
Have you got the editor set to the right chip. Presumably the code was written for a 28X1.


 You were quite correct...Sorry 'bout that...the editor was still set to the default '18'.....when I set it up for the 28x1,  everything was just fine.....

Sometimes old age sucks !!!


Indiana, USA