Code:
if (rc_dig_in18=1) {
if (cnttick < 34 )
{
pwm05 = 60;
}
if (cnttick > 35 )
{
pwm05 = 127;
}
if (cnttick < 30 )
{
pwm04 = 0;
}
if (cnttick < 32 )
{
pwm04 = 127;
}
//raises arm up for 40 ticks 1 second(s) /\ /\
// drive motors from here on out \/ \/
if (cnttick > 35 && cnttick < 90 )
{
pwm01 = 190;
}
if (cnttick > 35 && cnttick < 90 )
{
pwm02 = 190;
}
if (cnttick > 92 && cnttick <= 122)
{
pwm01 = 190;
}
if (cnttick > 92 && cnttick <= 122)
{
pwm02 = 53;
}
if (cnttick > 130 && cnttick < 160 )
{
pwm01 = 190;
}
if (cnttick > 130 && cnttick < 160)
{
pwm02 = 190;
}
if (cnttick > 163 && cnttick <= 183)
{
pwm01 = 190;
}
if (cnttick > 163 && cnttick <= 183)
{
pwm02 = 53;
}
if (cnttick > 223 && cnttick < 250 )
{
pwm01 = 190;
}
if (cnttick > 223 && cnttick < 250 )
{
pwm02 = 190;
}
if (cnttick > 255 && cnttick <= 275)
{
pwm01 = 190;
}
if (cnttick > 255 && cnttick <= 275)
{
pwm02 = 53;
}
}
else {
pwm01=210;
}
when i do it like that reguardless of the switch it always works like the switch is on even when its off.
__________________
If saftey is first and i put FIRST ahead of everything, then i must be the safest guy in the world.
Team 521 Alumni -- Team 1740 Mentor-- Go Go 1740!
Sometimes I think I've been doing this too long and other times I think I haven't done this enough... but all the times I'm sure I'm crazy
Photonics, It's Your Future