IZU2020 / PQLPS22HB

Dependents:   IZU2020_AVIONICS qqq_izu_main_test IZU2020_AVIONICS Hybrid_OB2021_MAIN

Revision:
1:e77331b61ce6
Parent:
0:9b51ce752415
Child:
3:b2e1b4e9fdf8
diff -r 9b51ce752415 -r e77331b61ce6 PQLPS22HB.cpp
--- a/PQLPS22HB.cpp	Tue Dec 17 09:11:42 2019 +0000
+++ b/PQLPS22HB.cpp	Tue Dec 17 14:18:04 2019 +0000
@@ -10,14 +10,14 @@
 
 void LPS22HB :: begin()
 {
-    cmd[0] = CTRL_REG1;
+    cmd[0] = LPS22HB_CTRL_REG1;
     cmd[1] = 0x40;
     _i2c -> write(_addr, cmd, 2);
 }
 
 bool LPS22HB :: test()
 {
-    cmd[0] = WHO_AM_I;
+    cmd[0] = LPS22HB_WHO_AM_I;
     _i2c -> write(_addr, cmd, 1);
     _i2c -> read(_addr, buff, 1);
     if(buff[0] == 0xB1) {
@@ -35,7 +35,7 @@
 
 void LPS22HB :: read_press(float *press)
 {
-    cmd[0] = PRESS_XL;
+    cmd[0] = LPS22HB_PRESS_XL;
     _i2c -> write(_addr, cmd, 1);
     _i2c -> read(_addr, buff, 3);
     *press = (short)(buff[0] | buff[1] << 8 | buff[2] << 16) / 4096.0f;
@@ -43,7 +43,7 @@
 
 void LPS22HB :: read_temp(float *temp)
 {
-    cmd[0] = TEMP_L;
+    cmd[0] = LPS22HB_TEMP_L;
     _i2c -> write(_addr, cmd, 1);
     _i2c -> read(_addr, buff, 2);
     *temp = (short)(buff[0] | buff[1] << 8) * 0.01;