It could be a timing issue. No time to check now. If anyone could?
Ioannis
I am just getting started on this again tonight...
I the example from Skimask above, the variable CMD is I assume an array of 16 bits? so I should declare..
Am I correct?Code:CMD VAR bit[16]
My next question is how do I get my word variable into series of 16 bits?
Code:dout = $D0F7 for n = 16 to 0 step -1 CMD[n] = %dout.15 dout << 1 next n
Keep in mind I am almost certain that the above example will not work... It's just to show that I am trying, not just asking everyone else to make my project for me...
My current attempt is....
This results in ... 1000000111101110 ... and I want ... 1100000011110111 ...Code:cmd var byte[15] dout = $C0F7 ... lcdout $fe,$C0," " for n = 16 to 1 step -1 CMD.0[n] = dout.15 dout = dout << 1 lcdout $fe,14,bin dout.15 next n
i.e. It has chopped the 1 off the start, and added a 0 on the end...
I just realised what I did...
dout = dout << 1
lcdout $fe,14,bin dout.15
I was displaying the dout bit after it had shifted... Stupid me.. I swapped those 2 lines, and I know I am giving the right string of bits to the array...
I'm trying to display the array to see if all those bits went in.. Something is not right tho.
This last bit where I try to display the cmd array just gives me garbage characters.Code:n VAR BYTE nn VAR BYTE cmd VAR BYTE[15] ... lcdout $fe,$C0," " for n = 15 to 0 step -1 CMD.0[n] = dout.15 lcdout $fe,14,bin dout.15 dout = dout << 1 next n lcdout $fe,$d4," " for nn = 0 to 15 lcdout $fe,$14,cmd.0[nn] next nn
Last edited by davewanna; - 10th June 2008 at 11:03.
I have just read a very in depth post by Melanie about bits in bytes, and arrays etc...
I think I understood most of it.. and have changed my code to....
However it still doesn't seem to have solved my problem. I am still getting the wierd character in the bottom lcdout array..Code:n VAR BYTE nn VAR BYTE cmd VAR BYTE[16] ... lcdout $fe,$C0," " for n = 15 to 0 step -1 CMD[n] = dout.15 lcdout $fe,14,bin dout.15 dout = dout << 1 next n lcdout $fe,$d4," " for nn = 0 to 15 lcdout $fe,$14,cmd(nn) next nn
Bookmarks