Page 1 of 1
Analog value with I2C display ssd1306
Posted: Thu Oct 09, 2025 12:34 pm
by JulianL
Hello,
I would like to ask for your help.
I am using Flowcode together with an Arduino and would like to read in an analog value and display it on an I2C SSd1306 display.
Problem: No permanent value is displayed.
You can find my program in the attachment.
Thank you for your help.
Re: Analog value with I2C display ssd1306
Posted: Thu Oct 09, 2025 12:54 pm
by mnfisher
You are constantly updating the display in a loop - this means it will refresh very rapidly probably with slightly different values.
Try adding a delay.
Also - if the value's representation changes in length (say '10' then '9') - it will not clear trailing digits. One way round this is to convert the value to a string and append some spaces.
.str = ToString$(.value)
.str = .str + ' '
Display(.str) (PrintString from memory)
where .str is a (in this case local variable) declared as a string.
Martin
Re: Analog value with I2C display ssd1306
Posted: Thu Oct 09, 2025 1:28 pm
by medelec35
Hello.
In addition to Martin's reply, with he print function you need to have the Transparency Set to 0 and not 1.
This will make sure that that in the same location, the previous digit is overwritten.
What you are showing is all previous digits in the same location remaining.
That will prevent you from seeing what the current digit is.
Re: Analog value with I2C display ssd1306
Posted: Fri Oct 10, 2025 11:53 am
by JulianL
Hello,
Thanks for your help.
@Martin: Could you show me an example program for your idea using a flowchart? I don't quite understand how I can implement it.
Best regards, Julian
Re: Analog value with I2C display ssd1306
Posted: Fri Oct 10, 2025 8:21 pm
by mnfisher
Hi Julian,
Something like this - it runs AOK in simulation - in hardware you might need to check the pins used (C0 for ADC for example)
Adding a SetFontScaler(2,2) makes the display easier to read! (from the gLCD component)
Martin