lcd_i2c component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
riven
Posts: 1
Joined: Sun May 31, 2020 11:02 am
Contact:

lcd_i2c component

Post by riven »

Hi I need to change I2C address and will then get this from a variable.
the reason is that my I2C chips do not always have the same address as I will then make a autosearch for the address and store it in a variable so that I then can use it lcd_I2C address. autosearch part I get but I am unable to change I2C address in lcd_i2c component.

is there anyone who can give me an example of how I can change i2c address


thanks

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: lcd_i2c component

Post by mnf »

Unfortunately - the flowcode component has the address 'hardcoded' in - have a look at the C code (for example SendCommand). For example in the case of SSD1306(i2c) - 120....

The actual address is only used in a few places (SendCommand for example) - so these could be modified to use a variable rather than a constant...
With the source to the component - this would be straightforward (Seti2cAddress macro??) Benj might oblige?

Harder(!) - copy the C code to supplemntary code for the project and modify the commands you need (for example Print) to take an address as an extra argument of address (if you need more than one display) or to use a variable - if just one display...

Martin

Post Reply