Multitasking ?
-
- Posts: 327
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 173 times
- Been thanked: 104 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: 1
- Joined: Sat Mar 02, 2024 1:32 am
- Has thanked: 3 times
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: 1901
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 407 times
- Been thanked: 1272 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: 327
- Joined: Tue Jun 21, 2022 2:17 pm
- Location: South coast UK
- Has thanked: 173 times
- Been thanked: 104 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