WebTruck Moving out
Guest

steering jal code

-- all the steering related stuff




-- --------------------------------------------------------------------
-- Steering
-- --------------------------------------------------------------------




procedure setsteer is

-- check minimum / maximum values
if steer < sright then
steer = sright
elsif steer > sleft then
steer = sleft
end if

-- if steer < shright then
-- steercount = steercount - 1
-- elsif steer > shleft then
-- steercount = steercount + 1
-- end if

-- if steercount >= 250 | steercount <= 5 then
-- steer = smiddle
-- steercount = 0
-- end if

-- check constant nosteer, generate pulse for servo
if nosteer == 0 then
spulse = high
delay_10us( steer )
spulse = low
end if

end procedure