Skip to content

Qt class for reading 3-axis sensor data in (embedded) Linux

Notifications You must be signed in to change notification settings

Makskuk/ThreeAxisSensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThreeAxisSensor

Qt class for reading 3-axis sensor data in (embedded) Linux

There are QObject-derived class and test app.

Tested on Linux 4.1 with standard drivers:

  • accelerometer mma8451
  • magnetometer mag3110

Example:

  ThreeAxisSensor accel("mma845x");
  QObject::connect(&accel, &ThreeAxisSensor::readingsChanged,
                   [](int x, int y, int z){
      qDebug()<<"x:" << x << "y:" << y << "z:" << z;
  });

  accel.setPollInterval(500);
  accel.setActive(true);

Class operates with driver's sysfs interface. Proper fiels finding automatically by given sensor name. Sensor name could be set in constructor or with setDevice(QString sensorName) method. It must be name of sensor's driver.

Note: class reads raw sensor data. To interpret data see to sensors' datasheet/appnote.

About

Qt class for reading 3-axis sensor data in (embedded) Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published