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)
DS18B20 component not working on FC10?
-
- 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?
- 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.
Re: DS18B20 component not working on FC10?
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.
But still, I understand that I shouldn't work this way.
-
- 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?
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
Martin
Re: DS18B20 component not working on FC10?
Following your advice, I have implemented interrupt-controlled multiplexing and it works perfectly.mnfisher wrote: ↑Sat Apr 12, 2025 9:59 amYou 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
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