Instead of "TEXT1", use [#T,#E,#X,#T,#1...etc]
Don't overwrite your buffer.
Instead of "TEXT1", use [#T,#E,#X,#T,#1...etc]
Don't overwrite your buffer.
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
Oops, my bad... that's for serial stuff.
Try:
text var byte[5]
test[4] = "T"
test[3] = "E"
test[2] = "X"
test[1] = "T"
test[0] = "1"
I2cwrite SDA, SCL,$A0,I,[char test\5, {your other data to send} ]
I don't know if the array is sent out lowest ([0]) or highest ([4]) first. Reverse array asignments if it comes out backwards.
Last edited by JD123; - 27th March 2008 at 19:23.
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
I2cwrite SDA, SCL,$A0,I,[ "T" , "E" , "X" , "T" , "1" ].....
should also work. (not 100% sure, haven't tried myself, but it should work)
What you originally had was an embedded string, which PBP doesn't natively handle. ( "TEXT1" ). A byte array of characters as noted in the post preceeding can be used as a string, but is not really a 'string' as far as PBP is concerned.
Hi, something like the following will work.
Code:EEP1 con %10100000 ' First EEPROM A<2:0>=Gnd Addr var word ByteA var byte ByteB var byte PAUSE 50 addr=0 BYTEA="A" byteb="B" I2CWRITE SDA,SCL,EEP1,ADDR,[bYTEA," TEXT1",BYTEB," TEXT2"] PAUSE 10 FOR ADDR=0 TO 13 I2Cread SDA,SCL,EEP1,ADDR,[bYTEA] hserout [BYTEA] next @ GOTO $
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
[QUOTE=skimask;53213]I2cwrite SDA, SCL,$A0,I,[ "T" , "E" , "X" , "T" , "1" ].....
should also work. (not 100% sure, haven't tried myself, but it should work)
What you originally had was an embedded string, which PBP doesn't natively handle. ( "TEXT1" ). A byte array of characters as noted in the post preceeding can be used as a string, but is not really a 'string' as far as PBP is concerned.[/QUOTE
I used this and not work .Read and display step by step only " T " ,first karakter .
........................................
test var byte[5]
test[4] = "T"
test[3] = "E"
test[2] = "X"
test[1] = "T"
test[0] = "1"
ADCON1 = 7
TRISB = 0
TRISC = 0
start:
DISABLE INTERRUPT
scriere:
FOR i = 1 TO 20
I2cwrite SDA, SCL,$A0,I,["T","E","S","T","1"]
pause 30
NEXT i
........................................
Last edited by Eugeniu; - 27th March 2008 at 20:48.
Bookmarks