HELP needed for a new guy.
Archiver
Posts: 46,084
I am new to pbasic but am making good progress. Here is my problem. I
have managed to get my program to display a VAR I cal ANGLE. When I
used the DEBUG command, I get the desired Decimal number displayed in
the debug terminal in the range of 0 to 9999. However, I want to
display this number on a bank of 4 TIL311 displays. TIL311's latch
and decode and display a nible of hex data. I have the TIL311's in
groups of 2 and connected to P0 - P7. So, lets say my program's
function results in ANGLE being egual to 1234. How do I output "34"
to digits 0 and 1 and "12" to digits 2 and 3? To output "34" to
digits 0 and 1, I would have to write 00110100. Do I have to convert
from HEX to BCD?
have managed to get my program to display a VAR I cal ANGLE. When I
used the DEBUG command, I get the desired Decimal number displayed in
the debug terminal in the range of 0 to 9999. However, I want to
display this number on a bank of 4 TIL311 displays. TIL311's latch
and decode and display a nible of hex data. I have the TIL311's in
groups of 2 and connected to P0 - P7. So, lets say my program's
function results in ANGLE being egual to 1234. How do I output "34"
to digits 0 and 1 and "12" to digits 2 and 3? To output "34" to
digits 0 and 1, I would have to write 00110100. Do I have to convert
from HEX to BCD?
Comments
angle var word
angle=1234
x.nib0 = angle dig 0
x.nib1 = angle dig 1
' puts %00110100 in x
' see the dig operator in the Stamp manual
>I am new to pbasic but am making good progress. Here is my problem. I
>have managed to get my program to display a VAR I cal ANGLE. When I
>used the DEBUG command, I get the desired Decimal number displayed in
>the debug terminal in the range of 0 to 9999. However, I want to
>display this number on a bank of 4 TIL311 displays. TIL311's latch
>and decode and display a nible of hex data. I have the TIL311's in
>groups of 2 and connected to P0 - P7. So, lets say my program's
>function results in ANGLE being egual to 1234. How do I output "34"
>to digits 0 and 1 and "12" to digits 2 and 3? To output "34" to
>digits 0 and 1, I would have to write 00110100. Do I have to convert
>from HEX to BCD?