Multitasking ?
-
- Posts: 344
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 179 times
- Been thanked: 112 times
Re: Multitasking ?
I have finally started using this new version of tempr$, which is excellent and allows much better updating. The routine is called once every three seconds, which is ample time for the conversions, and it is all non-blocking. I use the sensor id string to distinguish between them, e.g this is in the setup:
the disp_temp lines are a sub that writes to a tft display. To get the sensor id strings use tempr$(temp_pin), list the result and copy it into your code.
Code: [Local Link Removed for Guests]
ext_sensor_id$ = "28db49ec00000063"
hw_sensor_id$ = "28883c18291901ce"
ch_sensor_id$ = "288978c400000006"
ret_sensor_id$ = "289764c400000013"
temp_pin = 13 'all sensors on this pin
ret$ = tempr$(temp_pin,0) 'request all readings
Code: [Local Link Removed for Guests]
'===========
read_temps:
'===========
'read and display each temperature
local_ext_temp = val(tempr$(temp_pin,ext_sensor_id$))
flow_temp = val(tempr$(temp_pin,ch_sensor_id$) )
disp_temp c4,r3,flow_temp
ret_temp = val(tempr$(temp_pin,ret_sensor_id$))
disp_temp c4,r4,ret_temp
hw_temp = val(tempr$(temp_pin,hw_sensor_id$) )
disp_temp c4,r2,hw_temp
'ask for the next time
ret$ = tempr$(temp_pin,0) 'request all readings, also once in startup
return
-
- Posts: 3
- Joined: Sat Mar 02, 2024 1:32 am
- Has thanked: 6 times
- Been thanked: 1 time
Re: Multitasking ?
How was the implementation in 8266? That's what I'm struggling with here, and asynchronous mode would be a good solution, which unfortunately isn't available yet.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Jan 30, 2023 10:23 amI'll try to include the changes also in the ESP8266[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Jan 27, 2023 5:30 pm Any chance we might see it for 8266 as well?
- cicciocb
- Site Admin
- Posts: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 426 times
- Been thanked: 1321 times
- Contact:
Re: Multitasking ?
It is still not implemented in the ESP8266 and I strongly suggest to move toward the ESP32[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Mar 29, 2024 8:08 amHow was the implementation in 8266? That's what I'm struggling with here, and asynchronous mode would be a good solution, which unfortunately isn't available yet.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Mon Jan 30, 2023 10:23 amI'll try to include the changes also in the ESP8266[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Jan 27, 2023 5:30 pm Any chance we might see it for 8266 as well?
-
- Posts: 344
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 179 times
- Been thanked: 112 times
Re: Multitasking ?
It would be really nice to have it for the 8266.
Using an ESP32 just to read a few sensors is simply overkill.
Not to mention implementation on existing hardware.
Pretty please
Using an ESP32 just to read a few sensors is simply overkill.
Not to mention implementation on existing hardware.
Pretty please
- cicciocb
- Site Admin
- Posts: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 426 times
- Been thanked: 1321 times
- Contact:
-
- Posts: 3
- Joined: Sat Mar 02, 2024 1:32 am
- Has thanked: 6 times
- Been thanked: 1 time
Re: Multitasking ?
How exactly is this supposed to work for version 1.49 of 21/03/2024 19:08? I would expect version 1.50... maybe...[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri Mar 29, 2024 7:15 pm Try again the 1.49, it could work now
Heartfelt thanks for taking the time to do this!
- cicciocb
- Site Admin
- Posts: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 426 times
- Been thanked: 1321 times
- Contact:
Re: Multitasking ?
Sorry, I forgot to upload
Try the latest 1.50 and let me know because I didn't tested
Try the latest 1.50 and let me know because I didn't tested
-
- Posts: 3
- Joined: Sat Mar 02, 2024 1:32 am
- Has thanked: 6 times
- Been thanked: 1 time
Re: Multitasking ?
BEAUTIFUL HOPE! It looks functional according to the log dump.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat Mar 30, 2024 10:21 am Sorry, I forgot to upload
Try the latest 1.50 and let me know because I didn't tested
283425d32519012d start...
94 - START
113 - WAIT
230 - WAIT
347 - WAIT
464 - WAIT
581 - WAIT
698 - WAIT
815 - WAIT
932 - 22.625
1076 - 22.625
1220 - 22.625
1364 - 22.625
1508 - 22.625
1652 - 22.625
1796 - 22.625
konec zvonec.
Thank you for the others and have a nice Easter!
Honor your work!
- cicciocb
- Site Admin
- Posts: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 426 times
- Been thanked: 1321 times
- Contact: