Hi,
The $55 is nothing in particular, just a number like any other number fitting into a byte, could have been 85 or 010101 (they are all the same thing by the way). It was just a number I took it doesn't mean or do anything in paricular in the example.
There are many ways to put Var1-Var3 in the array. The most obvious would be to simply copy them:Another, perhaps more elgant way is to create aliases pointing into the arrayCode:myByteArray[0] = Var1 myByteArray[1] = Var2 myByteArray[2] = Var3This way you can use FOR-NEXT loops etc to index the array AND access each entry just like any other byte. Remember that in this case there are only three bytes in RAM, Var1 is the same as myArray[0] - just another 'name' for it - for convinience. LikeCode:myByteArray VAR BYTE[3] Var1 VAR myByteArray[0] Var2 VAR myByteArray[1] Var3 VAR myByteArray[2]
The first line puts the value 128 in the first location of the array. The second line prints the content of Var1 which is the same thing as the first location of the array.Code:myByteArray[0] = 128 HSEROUT[#Var1, 13]
If your databits are comming in on PortB.1 and, I assume you have some sort of clock or something on PortB.0, then something like:Something like that...Code:Counter = 0 While Counter < 128 While PortB.0 = 0 : WEND 'Wait here for rising edge of clock. myBitArray[Counter] = PortB.1 'Get state of pin and store in array While PortB.0 = 1 : WEND ' Wait for clock to return low Counter = Counter + 1 ' Prepare for next bit WEND
/Henrik.




Bookmarks