IZU2020 / PQINA226

Dependents:   IZU2020_AVIONICS IZU2020_AVIONICS

Files at this revision

API Documentation at this revision

Comitter:
tanahashi
Date:
Wed Dec 04 09:37:02 2019 +0000
Parent:
2:2a98c184354f
Child:
4:9e7136efda5c
Commit message:
added POWER_LSB

Changed in this revision

PQINA226.cpp Show annotated file Show diff for this revision Revisions of this file
PQINA226.h Show annotated file Show diff for this revision Revisions of this file
--- a/PQINA226.cpp	Wed Dec 04 08:18:37 2019 +0000
+++ b/PQINA226.cpp	Wed Dec 04 09:37:02 2019 +0000
@@ -53,5 +53,5 @@
     cmd[0] = POWER;
     _i2c->write(_addr, cmd, 1);
     _i2c->read(_addr, buff, 2);
-    *power = (short)(buff[0] << 8 | buff[1]);
+    *power = (short)(buff[0] << 8 | buff[1]) * POWER_LSB;
 }
--- a/PQINA226.h	Wed Dec 04 08:18:37 2019 +0000
+++ b/PQINA226.h	Wed Dec 04 09:37:02 2019 +0000
@@ -7,6 +7,7 @@
 #define CALIBRATION 0x05
 #define WHO_AM_I 0xFF
 #define VOLTAGE_LSB 1.25
+#define POWER_LSB 25
 
 typedef enum A0 {
     A0_GND = 0b00,