
Comment by Hessel on April 13, 2009 at 2:50am
unsigned char latch = 0; // state lock switch; ulocked
// code modified to allow switchting modes using analog channel
if(pulse_length < 1200) //If the PWM pulse is less than 1200 ms
{
if (latch == 0) // if state unlocked
{
latch = 1; // lock state
if (state == 2) // if in auto mode 01
state = 0; // return to manual
else
state = 2; // engage auto mode 01
}
}
else
{
if(pulse_length > 1800) //if the PWM pulse is greater than 1800 ms
{
if (latch == 0) // if state unlocked
{
latch = 1; // lock state
if (state == 1) // if in auto mode 02
state = 0; // return to manual
else
state = 1; // engage auto mode 02
}
}
else//If not the value is between 1200 and 1800 ms, so
latch = 0; //state unlocked
}
Comment by Hessel on April 28, 2009 at 12:31pm
unsigned char latch = 1; // state lock switch; locked manual mode on power-on
Comment by Hessel on April 30, 2009 at 2:15am Comment
Season Two of the Trust Time Trial (T3) Contest has now begun. The third round was a reliablilty/aerial photography round for both planes and copters, which is now closed. Stay tuned for the next round, beginning soon.61 members
57 members
95 members
108 members
617 members
© 2012 Created by Chris Anderson.

You need to be a member of DIY Drones to add comments!
Join DIY Drones