Help!!
torkroll
Posts: 2
hello .
·having trouble with some code . it is for fying an rc aircraft . it detects the pwm on pin 8 and depending on the mesured width it either passes signals from pin 4 to 7 onto pin 0 to 3. or take readings from ·H48C Tri-Axis Accelerometer and move a servo accordingly. everthing works good but it wont·switch from pass to accelerometer mode. it switches from accel' to pass mode but not the other way.
·having trouble with some code . it is for fying an rc aircraft . it detects the pwm on pin 8 and depending on the mesured width it either passes signals from pin 4 to 7 onto pin 0 to 3. or take readings from ·H48C Tri-Axis Accelerometer and move a servo accordingly. everthing works good but it wont·switch from pass to accelerometer mode. it switches from accel' to pass mode but not the other way.
Comments
pub readdata |z
Debug.start(31, 30, 0, 57600)
repeat
X := BS2.PULSIN_uS(8,1) ' Measure time PWM high for
if x < 1500
pass.stop
coglvl := cognew(le_vel,@stack2)
else
cogstop(coglvl~ - 1)
pass.start
WD1_Flag:=1 ' Set Watch dog flag
WD1_Timer := 100 ' Set timeout period, re-intialize each pass
z:= BS2.PULSIN(19,1) ' Get/wait for pulse