PDA

View Full Version : Dira question



T Chap
01-30-2007, 01:53 PM
dira[0..7] := 1

Can you not set a set of outs with this method? It isn't working so I guess not.

Mike Green
01-30-2007, 02:06 PM
dira[0..7] is an 8 bit value. You're setting this to 1 which is %00000001. If you want to set these pins all to outputs, you need to set it to %11111111 which is the same as $FF or 255. You could also use the notation "dira[0..7]~~" which sets all the bits to ones.

T Chap
01-30-2007, 02:10 PM
Great Thanks Mike! If the range is say dira[8-15] := 1 do you have to write the entire string from the first bit or start at bit 9 like

dira[8-15] := %11111111 ' 8 - 15 to outs

Post Edited (originator) : 1/30/2007 6:19:11 AM GMT