DS18B20 component not working on FC10?

For general Flowcode discussion that does not belong in the other sections.
Carmelo
Posts: 121
http://meble-kuchenne.info.pl
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: DS18B20 component not working on FC10?

Post by Carmelo »

I have been trying to see and find why this flickering of reading value happens.
I have come to the conclusion that it occurs when I want to take a second (and subsequent) sensor readings.
I attach a copy of the example where within the while I have placed a statement so that a single reading is produced and that value is then displayed indefinitely. The value is always shown constant.
The next step has been to enable the blocks within the condition so that the temperature value is repeated indefinitely, with the result that this is where the flashing of the displays begins.

Can you tell me any way on how to implement that this flickering does not occur for successive readings?

My opinion is that I think it is the block: SampleAllDevice (Perform temperature conversion - wait for completion)
Attachments
Test.fcfx
(81.57 KiB) Downloaded 4 times
Last edited by Carmelo on Fri Apr 11, 2025 5:48 pm, edited 2 times in total.

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: DS18B20 component not working on FC10?

Post by Carmelo »

I have changed the variable: wait for completion to =0 and now the blinking is much faster, because I estimate that now it is not waiting to perform the conversion.
But still, I understand that I shouldn't work this way.

mnfisher
Valued Contributor
Posts: 1453
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 707 times

Re: DS18B20 component not working on FC10?

Post by mnfisher »

You would be better to use an interrupt (timer) to drive the display multiplex. Every time the main loop does something it delays the refresh - causing the flashing. Then the main program can read the temperature and update the value as required (say every minute or more often if required)


Martin

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: DS18B20 component not working on FC10?

Post by Carmelo »

Gracias por la respuesta.
Intentaré realizar lo indicado y expondré el resultado obtenido.

C.

Carmelo
Posts: 121
Joined: Thu Oct 14, 2021 10:04 am
Has thanked: 49 times
Been thanked: 4 times

Re: DS18B20 component not working on FC10?

Post by Carmelo »

mnfisher wrote:
Sat Apr 12, 2025 9:59 am
You would be better to use an interrupt (timer) to drive the display multiplex. Every time the main loop does something it delays the refresh - causing the flashing. Then the main program can read the temperature and update the value as required (say every minute or more often if required)

Martin
Following your advice, I have implemented interrupt-controlled multiplexing and it works perfectly.
Now I can read the temperature value of the NTC in the period of time I want and the reading is perfectly stable.

Thank you very much for the advice.

Carmelo

mnfisher
Valued Contributor
Posts: 1453
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 707 times

Re: DS18B20 component not working on FC10?

Post by mnfisher »

Good news - glad it's working well for you....

Martin

Post Reply