Please Help Me Code-People and Fritz

Hey Fritz (and code people)

I am still using your good ol' (the one using the fr05)... and it's still great! I modified it to run servos as motors instead of a motor dirver chip. --Here's the deal, I am using a FR05 on a servo in the standard configuration but the way I have it mounted is quite high up. I have added (2) Sharp IR distance sensors down low in order to catch anything that the FR05 misses. Sort of a "whoa, I didn't see that..." extra safety.

Here is what I am trying to insert --I thought it would be super simple!!

readadc 1,w4
if w4 => irdanger then goto Sharp_L
readadc 2,w5
if w5 => irdanger then goto Sharp_R

(with symbol irdanger = 120 at the start of the code)

For the life of me, I can not find out where in you code to stick this little "widget". I have tried:

-At the start of Afterturn

-At the start of tester

-At the start of puls

and at the start of driveahead

None of them work or they cause the FR05 servo to go crazy or... ... I dunno, it just doesn't work!

 

Any thoughts? I can give you the whole code I am using if you would like to look at it.

Wait, I think I got it, maybe…

Its a return loop problem, huh?

www.rocketbrandcustom.com baby!!

It may be a return-problem -

It may be a return-problem - I cannot tell from the small part You provide.

It may also be a problm with variables / registers; you should look into that: Read up on "variables" so much that you can tell why it is stupid to use word-variables the way you do… and why it may be the reason why things controlled by byte-variables "goes crazy" :slight_smile:

/ Fritsl

This may be unrelated but my
This may be unrelated but my servo went nuts when the ground pin wasn’t properly soldered into place. It would turn all the way to one side or just jerk back and forth. Make sure the connection is tight. If that doesn’t do it publish a larger block of your code with comments where you have tried inserting the above block.