I digress.
Switches can be an effective way to implement autonomous mode if you are storing your multiple autonomous programs in multiple program slots. This is how we do it:
Code:
auto_selection VAR tempvar3
auto_select VAR auto_selection.nib0
auto_bit1 VAR auto_selection.bit0
auto_bit2 VAR auto_selection.bit1
auto_bit3 VAR auto_selection.bit2
if active_button = 1 then
auto_bit1 = auto_select0
auto_bit2 = auto_select1
auto_bit3 = auto_select2
endif
if auto_button = 1 OR auton_mode = 1 then
select (auto_select)
case 0 'joy 1
run 2
case 1 'joy 2
run 3
case 2 'joy 3
run 4
case 3 'joy 4
run 5
case 4 'joy 5
run 2
case 5 'joy 6
run 3
case 6
run 4
case 7
'do nothing... just in case :-)
endselect
else
gosub operator_control
endif
And really, it works quite efficently
