[riot-notifications] [RIOT-OS/RIOT] drivers: add driver for APDS99XX ambient light and proximity sensors (#10420)

benpicco notifications at github.com
Sun Sep 15 22:08:08 CEST 2019


benpicco commented on this pull request.



> +    uint16_t ch0 = (data[1] << 8) | data[0];
+    uint16_t ch1 = (data[3] << 8) | data[2];
+
+    /* define some device dependent constants */
+    double df = 52;
+#if MODULE_APDS9900 || MODULE_APDS9901
+    double ga = 0.48;   /* glas or lens attenuation factor */
+    double b = 2.23;
+    double c = 0.7;
+    double d = 1.42;
+#else
+    /* APDS_9930 */
+    double ga = 0.49;   /* glas or lens attenuation factor */
+    double b = 1.862;
+    double c = 0.746;
+    double d = 1.291;

If you multiply them all by 1000, you wouldn't need to use `double` here, no?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10420#pullrequestreview-288379640
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190915/c52dc3f6/attachment.htm>


More information about the notifications mailing list