Basic Atom Programming Help Needed

Ok Basically this is my pseudocode. It's very rough though I did it in around a minute.

main:

start both wheel servos full speed

if object too close in sight move back and move ir sensors left and right to choose direction

if object is blocking left side and not right.. right servo spins backwards and then both servos at full speed

if object is blocking right side and not left... left servo spins backwards then both servos at full speed

if object is blocking both sides... move back and make right servo moves backwards and goto main

Right now what I have is this... and it works, but not the way I want it. I want the servo to always be moving.

Main:

if IN12 = 0 then

servo P8, 1500

Endif

goto Main

Since that last code didn't work to well I tried this code below which didn't do anything.

Main:

if IN12 = 0 then

high P8

Endif

goto Main

PS if anyone is wondering what if IN12 = 0 is... it's a button on my bot board. :P

Can anyone help me find a code to always keep 2 servos continously moving until it detects something?

servo and commands

You write that “it works, but not the way I want it”. But you don’t tell us what it does. Does it jerk and stop? With every command it gets, or just once until you manually reset it?

From the top of my head:
This servo is designed or modified for continuous rotation, right?
Did you ever have it rotate, continuously? Is it just this code that won’t work?

Your second code example will never work on a servo. A servo requires a special kind of pulse. The “high P8” will only feed your servo a flat high voltage. The onboard controller (inside the servo) will not understand it.

It doesn’t work the way I want to

The servos move only for a short period of time. The pulsout only lasts very little. I want them to ALWAYS be rotating until they meet an object infront of them.

"Can anyone help me find a code to always keep 2 servos continously moving until it detects something? "