diff options
author | Chris Xiong <chirs241097@gmail.com> | 2018-07-14 11:46:12 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2018-07-14 11:46:12 +0800 |
commit | ea652045bb38651d99bcc53972a524f602c3b306 (patch) | |
tree | ea7bf5f5b3f0a76faf07bfeb944b3a56f6afd527 /sensor_als.cpp | |
parent | e5aac499a8a2026af5d5176f45be3ac2576d75cc (diff) | |
download | lightsd-ea652045bb38651d99bcc53972a524f602c3b306.tar.xz |
Added a simple tool to create a fake sysfs backlight interface
that invokes external commands.
Some changes in the utility module to accomodate the new tool.
Added an option to watch ALS readings.
Diffstat (limited to 'sensor_als.cpp')
-rw-r--r-- | sensor_als.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sensor_als.cpp b/sensor_als.cpp index 88c3efc..8edd41c 100644 --- a/sensor_als.cpp +++ b/sensor_als.cpp @@ -1,6 +1,11 @@ //Chris Xiong 2018 //3-Clause BSD License +#include <cstdio> #include "sensor_als.hpp" +void SensorALS::set_debug(bool d) +{ + debug=d; +} void SensorALS::enable_scan_elements() { enable_scan_element("both"); @@ -9,5 +14,6 @@ void SensorALS::update_values() { value=std::any_cast<int>(dict["in_intensity_both_value"])* std::any_cast<float>(dict["in_intensity_scale"]); + if(debug)printf("ALS reading: %.2f\n",value); } float SensorALS::get_value(){return value;} |