Morning C;
The 256 multiplier is applied by the Basic when you use .HB
I put the 256 in as comment to show you what OSH will do with it.
Is that what you mean,?
E
Hi E,
Here's a section from a program with '.LB and 'HB' Showing no reference to ' * 256 = ' :
I wondered if it should have it?
[I'm happy to see what J comes up with, as he may be using a diffrerent method?]
C.
SPICSOn
SPISend r_t_xlsb 'READ ADDR TEMP xlsb from BMP280
SPIReceive t_xlsb 'Least sig Byte
SPISend r_t_lsb 'READ ADDR TEMP lsb from BMP280 MID
SPIReceive t_lsb 'mid sig Byte
SPISend r_t_msb 'READ ADDR TEMP msb from BMP280 MOST
SPIReceive t_msb 'Most sig BYTE
SPISend r_p_xlsb 'READ ADDR PRESSURE xlsb from BMP280
SPIReceive p_xlsb 'Least sig Byte
SPISend r_p_lsb 'READ ADDR PRESSURE lsb from BMP280 MID
SPIReceive p_lsb 'mid sig Byte
SPISend r_p_msb 'READ ADDR PRESSURE msb from BMP280 MOST
SPIReceive p_msb 'Most sig BYTE
SPICSOff
PORTD.5 = 1 'CHIP SELECT[hpa]OFF
WaitMs 10
PORTD.4 = 0 'CHIP SELECT 5110 ON
'Join all TEMP bytes as long
t_lsbnxlsb.LB = t_xlsb
t_lsbnxlsb.HB = t_lsb
t_msbnlsbnxlsb.LW = t_lsbnxlsb
t_msbnlsbnxlsb.HW = t_msb
'ASCII serial out of Bytes,Word or Single
msg1 = #t_msbnlsbnxlsb
t_msbnlsbnxlsb = ShiftRight(t_msbnlsbnxlsb, 4) ''''''''''''''''''''
'ASCII serial out of Bytes,Word or Single'''''''''''''''''''''''''''''
msg1 = #t_msbnlsbnxlsb '''''''''''''''''''''''''''''''''''''
WaitMs 10 'Does CS need time to switch? [SHORTEN OR REMOVE THIS LINE]
strtmp = #t_msbnlsbnxlsb
'#############################################################################
'Join all PRESS bytes as long
p_lsbnxlsb.LB = p_xlsb
p_lsbnxlsb.HB = p_lsb
p_msbnlsbnxlsb.LW = p_lsbnxlsb
p_msbnlsbnxlsb.HW = p_msb
'ASCII serial out of Bytes,Word or Single
msg1 = #p_msbnlsbnxlsb
p_msbnlsbnxlsb = ShiftRight(p_msbnlsbnxlsb, 4)