Shop OBEX P1 Docs P2 Docs Learn Events
NX-1000 Board and 7 Segment LED Display — Parallax Forums

NX-1000 Board and 7 Segment LED Display

Jason MJason M Posts: 3
edited 2007-07-21 19:26 in BASIC Stamp
I am currently trying to display 2·and 3 digit numbers on the NX1000 board - for example I want to display the number 80 - I can get the 8 to appear on the 2nd LED and 0 on the first but not at the same time -· Below is my code:

' {$STAMP BS2}
' {$PBASIC 2.5}
seg VAR Byte
x·· VAR Byte
y·· VAR Byte

DIRS··· =······ %011111111111111
seg = 80
x = seg DIG 1
y = seg DIG 0

LOOKUP 2,[noparse][[/noparse]%1110,%1101,%1011,%0111],OUTC
'················ .GFEDCBA
LOOKUP x,[noparse][[/noparse]%00111111, '0
·············· %00000110, '1
···············%01011011, '2
·············· %01001111, '3
·············· %01100110, '4
············· ·%01101101, '5
·············· %01111100, '6
···············%00000111, '7
···············%01111111, '8
·············· %01100111],OUTL

PAUSE 1000

LOOKUP 3,[noparse][[/noparse]%1110,%1101,%1011,%0111],OUTC
LOOKUP y,[noparse][[/noparse]%00111111, '0
·············· %00000110, '1
···············%01011011, '2
·············· %01001111, '3
·············· %01100110, '4
·············· %01101101, '5
·············· %01111100, '6
·············· %00000111, '7
·············· %01111111, '8
·············· %01100111],OUTL
PAUSE 1000

Thanks
Jason
Sign In or Register to comment.