Hello,
Have a Maestro 6ch hooked up to a flex sensor, servo & some leds. Want to have the leds off when sensor is straight and servo at position 1 then when bent leds on and servo position 2. Everything is great except for my leds which are backwards (on when straight off when bent). Button is on ch 1 servo on ch 0 and the leds on ch 5. Is there a way to reverse them in my code?
Thanks
begin
2250 0 300 servo_range
9000 300 600 servo_range
repeat
sub servo_range
pot 2 pick less_than logical_not
pot 2 pick greater_than logical_not
logical_and
if
begin
pot 2 pick 10 minus less_than logical_not
pot 2 pick 10 plus greater_than logical_not
logical_and
while
2 pick 0 servo
2 pick 5 servo
repeat
endif
drop drop drop
return
sub pot
1 get_position
return