Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5814

General discussion • Re: Capturing Data from Sensors Sequentially Using Raspberry Pi 5 and NRF24

$
0
0
What sensors are attached to the NRF24 trasnceiver modules?
Is there any reason why we cannot use the Pi to poll each NRF24 in turn (by address 1-6) once per minute?
That's the part where there is something missing from the setup. Because leaving everything like MQTT and other moving parts out of a design, the simplest way would be something like this:

Code:

sensors = [1, 2, 3, 4, 5, 6]while true:    now = get_time()    for sensor in sensors        data = get_data_from_sensor(sensor)  # where sensor sends just the last reading.        put_data_in_db(sensor, now, data)        sleep(x)

Statistics: Posted by memjr — Mon Jul 22, 2024 7:25 pm



Viewing all articles
Browse latest Browse all 5814

Trending Articles