Convert small 64bit signed integer into a high and low byte ?


Author Message
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3273
Posted: 11:33pm 14 Apr 2026      

  Quote  First attempt results in "Error : Argument Count"

a$=Bin2Str$(INT16,xmin,BIG)
I2C2 write &h50,0,4,1,0,a$

When writing a string to a 24Cxx EEPROM the 2 address bytes need to be added to the start of the data.
So perhaps try:-
a$ = Chr$(Mem.addr>>8) + Chr$(Mem.addr And 255) + a$ 'prepend 2 byte memory address to the data
I2C2 WRITE I2C.addr, 0, Len(a$), a$   'write 2 memory address bytes + up to 32 data bytes
Pause 6  'allow time to write


Currently you are trying to write a mix of integer bytes and a string which I2C WRITE doesn't accept.
Edited 2026-04-15 11:04 by phil99