Hey all. I've figured out how to read out bits from the input pins, save them to b0, and write them out to output pins using a Rube Goldbergish set of outputs:
etc.
Though this works, it does not pass for elegant code. Assuming I have four bits written in positions 3 to 0 on b0, what is the correct way to convert the bottom four bits of b0 to outputs without all this if-then kludging? I have read over the manuals, and don't see a clear instance of this. My hunch is that it involves masking, but I've not been able to get the syntax right.
Thanks as always,
--William
Code:
if b0 = %00000000 then low B.3, B.2, B.1, B.0 pause 100 endif
if b0 = %00000001 then low B.3, B.2, B.1 high B.0 pause 100 endif
if b0 = %00000010 then low B.3, B.2, B.0 high B.1 pause 100 endif
Though this works, it does not pass for elegant code. Assuming I have four bits written in positions 3 to 0 on b0, what is the correct way to convert the bottom four bits of b0 to outputs without all this if-then kludging? I have read over the manuals, and don't see a clear instance of this. My hunch is that it involves masking, but I've not been able to get the syntax right.
Thanks as always,
--William