Optional I2C parms

pmolsen

Senior Member
Allow optional parms on READI2C command. eg. when reading the realtime clock and you only want the months, allow:

readi2c 0,(,,,,,b1,)

Or else allow duplicate variables. eg.

readi2c 0,(b0,b0,b0,b0,b0,b1,b0)

At present you have to specify 7 unique variables. I don't have that many to spare and hence have to use peek and poke to save/restore the variables when doing the readi2c (adding to the size of the program, which is also near the limit!)
 

pmolsen

Senior Member
Oops. Just did a check syntax on the second one and it worked! But that then begs the question as to which value b0 gets set to.

I would still like to see the first option.
 

Technical

Technical Support
Staff member
The firmware cannot handle the first option, a variable must be present. However the second case does exactly what you want, the variable value after the command is the last read address (ie the value on the right).
 

pmolsen

Senior Member
The reason I posted it in the Suggestions forum is because I know the firmware cannot handle it. I was suggesting it as a future enhancement.
 

Technical

Technical Support
Staff member
Misunderstanding, what we meant was that we cannot currently change the Windows software compiler to accept ,,,, because currently the physical firmware requires a variable such as b0,b0,bo to be sent to it.

Unfortunately the firmware operation is not easy to change and so sending the dummy variable is the only real solution.
 
Also the writei2c command should allow the starting address to be optional. Most ADC's are not written to in the manner that EEPROMs are. They are I2C, but the write command only has a slave address and a command byte.

-Mike

 
Top