PDA

View Full Version : STR array



eyalbiton
- 2nd November 2024, 17:38
Hello

i try to use str array with array start point at i2cwrite and i got compiling error.

Example:
I2C var byte[128]
I2C_C var byte
Cell var byte ;start point of the array

I2C_C=32
Cell=32

i2cwrite sda2,scl2,%10100000,Eaddress,[str I2C[Cell]\I2C_C],ASKfail
if i use "[Cell]" i got error- (4150): "STR" modifier can only be used with a variable

if i use "Cell" (start point of the array) on debug or hserout or arraywrite it work fine
hserout [str I2C[Cell]\I2C_C]
debug str I2C[Cell]\I2C_C
arraywrite I2C[Cell],[x.x.x.x......]

Has anyone met with this problem?

Thanks

Ioannis
- 2nd November 2024, 21:13
The correct syntax of the STR in the command is STR I2C\count.

So what you are trying to do, send after specific point, 32 bytes of data, will not work.

Use a temp array to transfer the data you want and then use the I2CWrite command. See page 162 of the manual.

Ioannis

eyalbiton
- 3rd November 2024, 13:55
The correct syntax of the STR in the command is STR I2C\count.

So what you are trying to do, send after specific point, 32 bytes of data, will not work.

Use a temp array to transfer the data you want and then use the I2CWrite command. See page 162 of the manual.

Ioannis

Thanks for your reply.

of course i solved it in other way.
the purpose was to make it easier :-).

attached the code i made, it working perfect.
9808