Quantcast
Viewing all articles
Browse latest Browse all 4859

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



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?
You need to use epoll.h to monitor the file descriptor of the device.

Code:

extern "C" {#include sys/epoll.h}
That one is in c, it will work fine in c++.

You should wrap all the c headers with extern when using c++

Statistics: Posted by foxsquirrel — Mon Jun 17, 2024 2:31 am



Viewing all articles
Browse latest Browse all 4859

Trending Articles