I have a XC3746 8x16 Matrix -
When i try to run the Hardware I2C Code from the Datasheet i get …
exit status 1
expected ‘;’ before ‘}’ token
Arduino code is not my forte & i cannot see the error
Can anyone please help?
Arduino IDE 1.8.15
If you have carefully scanned the code and cannot see any statement that is not terminated with ‘;’ then there are possibly invisible characters in the code. Did you type it in or copy from somewhere? If it was copied, then paste the copy into a plain text editor such as Notepad and look for strange characters and delete them. VS Code is also useful for finding oddities. Or, for each line of code delete everything from the last character to the start of the next line and re-insert the line break.
If that’s not the problem post the code in the vicinity of the error and someone might look at it for you, but be aware that the actual problem might be some number of lines away from where it is reported.
Is this the datasheet you looked at?
Microsoft Word - XC3746.docx (jaycar.com.au)
If so, change this
Wire.write( table[data_line][i] )
Wire.write( table[data_line][i] ) ;
Nice to meet you even if only virtually
I really appreciate the help = very kind of you !!
Yes that was the datasheet - i simply copy/paste the code into Arduino IDE.
The errant ; is missimg from the original datasheet !!
I have made the change you suggested & now i do not get any error - the code uploads fine to the UNO.
HOWEVER i get nothing displayed on the Matrix
I have tested the matrix with other code & the display works fine so am not sure what is going on - maybe you can suggest something ?
Might be worth the author of the datasheet updating it to have the missing ; added so that other Arduino novices don’t run into this problem?
I am going to test the other code from the datasheet tomorrow & hope this will be more successful ?
Again Many Thanks
Do you have a link to the ‘other’ code that you are using? Comparing the two would likely reveal the cause of problem.
Sorry I forgot to add link to the last message…
Look for the section near the bottom titled “upload the code”
From.the little I understand this code "bitbangs* rather that accessing the hardware i2c ,?
It is similar to the 2nd example given in the datasheet you mention in a previous post
Hope this helps?
It is essentially the same code with the actual display changed slightly. That means the two pieces of code cannot be compared to reveal what the problem with that first example might be. It also appears that the datasheet relies on the bitbanging code - for instance there is no mention of the I2C address of the device, which is required for the library version but is ignored in the bitbanging version.
If you want to pursue the library version (which IMHO is well worthwhile) then the place to start is confirming the address of the device. This utility will enable you to determine whether it really is at address 0x40 as the code assumes, or some other address.
I have tried this beforehand & all I get is no device found …
From another forum I have been told that the controller AIP1640 is NOT an I2C device as it does not follow the I2C spec. It does not have an address byte or ACK bits …
Looks like bitbanging is the way to go …
Just wonder why the datasheet has a hardware i2c example when it’s not a hardware i2c compatible device ?
I really appreciate your helping me , it is very kind of you!
If the bitbanging code in that example works then that’s a pretty good indication that it’s not an I2C device.