Been trying to get GCB to clear bits in a subroutine. Take a variable, mask off all except the LSB, and use the result as a qualifier in an IF statement. My thick head cannot bend to the proper syntax.
Start:
fish = b'00010001'
fishout
goto Start
sub fishout
For Clocks = 1 to 8
bit = fish xor b'00000001'
If bit = 0 Then set Transmit Off
If bit = 1 Then set Transmit On
wait 1 sec
ROTATE fish Right
Next
Regards,
Kent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for that, but no go on using bit.0. Curious tho, that using an "and" mask works! Thought I had tried that before, but must not have had all the ducks lined up.
Regards,
Kent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Been trying to get GCB to clear bits in a subroutine. Take a variable, mask off all except the LSB, and use the result as a qualifier in an IF statement. My thick head cannot bend to the proper syntax.
Start:
fish = b'00010001'
fishout
goto Start
sub fishout
For Clocks = 1 to 8
bit = fish xor b'00000001'
If bit = 0 Then set Transmit Off
If bit = 1 Then set Transmit On
wait 1 sec
ROTATE fish Right
Next
Regards,
Kent
Try this?
If bit.0 = 0 Then set Transmit Off
If bit.0 = 1 Then set Transmit On
Thanks for that, but no go on using bit.0. Curious tho, that using an "and" mask works! Thought I had tried that before, but must not have had all the ducks lined up.
Regards,
Kent