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

C/C++ • How to implement a loop to read sensors

$
0
0
Hello,

let's suppose we want to read sensors, button press or other inputs from external devices using the Raspberry Pi.

To achieve this I think I should implement a loop (let's suppose to use C++) and red the inputs at each iteration. Which is the most efficient way to set up this loop? should I do something like while(true) and read all the sensors and other stuff at each iteration or there's a more efficient way?

Statistics: Posted by gev_u — Tue Jun 11, 2024 11:25 pm — Replies 1 — Views 48



Viewing all articles
Browse latest Browse all 4605

Trending Articles