take this elements in your code
Code:
number var word ' a word sized variable with 2 bytes
number = 350 ' give them the max value for testing
serout PORTA.3,t2400,[" the number are : ", number.byte0, number.byte1,13,11]
you receive now two values : 94 and 1. this two must be added
byte0 and byte1 has both a range from 0 to 255 (1byte = 8bit). but byte0 is the lowbyte and means really 0 to 255, but byte1 means how many times the value of 256. 256 is the value which is coming after 255 when byte0 is full.
some examples.
number = 0 : byte0 = 0, byte1 = 0 ' the minimum
number = 1 : byte0 = 1, byte1 = 0
number = 199 : byte0 = 199, byte1 = 0
number = 255 : byte0 = 255, byte1 = 0
number = 256 : byte0 = 0, byte1 = 1
number = 266 : byte0 = 10, byte1 = 1
number = 65536 : byte0 = 255, byte1 = 255 ' the maximum
Bookmarks