I2C sensor test program, derived from testI2C program. Simple test for FXOS8700CQ, HIH6130, MAG3110, MMA8451Q, MMA8452Q, MPL3115A2, MAX44000, MAX44005, MAX44008, MAX30101 included beside simple I2C read/write from testI2C.

Dependencies:   FXOS8700CQ HIH6130 IS31SE5000 MAG3110 MAX44000 MAX44005 MAX44008 MMA8451Q MMA8452Q MPL3115A2 VEML6040 VEML6075 mbed vt100 LM75B FXAS21002 MAX30101 VCNL4020 VCNL4100

Committer:
Rhyme
Date:
Thu Jul 07 04:06:16 2016 +0000
Revision:
5:cdac8329b22c
Parent:
3:be01d9e0fa3e
Child:
6:897f32c6ef7d
MAX44000 test routine was changed to be a one liner

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rhyme 0:d4bbd473a83c 1 #include "mbed.h"
Rhyme 0:d4bbd473a83c 2 #include "vt100.h"
Rhyme 0:d4bbd473a83c 3 #include "MSS.h"
Rhyme 0:d4bbd473a83c 4 #include "MSU.h"
Rhyme 0:d4bbd473a83c 5 #include "MMA8451Q.h"
Rhyme 0:d4bbd473a83c 6 #include "MMA8452Q.h"
Rhyme 0:d4bbd473a83c 7 #include "MAG3110.h"
Rhyme 0:d4bbd473a83c 8 #include "HIH6130.h"
Rhyme 0:d4bbd473a83c 9 #include "FXOS8700CQ.h"
Rhyme 0:d4bbd473a83c 10 #include "MAX44000.h"
Rhyme 0:d4bbd473a83c 11 #include "MAX44005.h"
Rhyme 0:d4bbd473a83c 12 #include "MAX44008.h"
Rhyme 0:d4bbd473a83c 13 #include "MPL3115A2.h"
Rhyme 0:d4bbd473a83c 14 #include "VEML6040.h"
Rhyme 0:d4bbd473a83c 15 #include "VEML6075.h"
Rhyme 3:be01d9e0fa3e 16 #include "LM75B.h"
Rhyme 0:d4bbd473a83c 17
Rhyme 0:d4bbd473a83c 18
Rhyme 0:d4bbd473a83c 19 extern int test_loop ;
Rhyme 0:d4bbd473a83c 20
Rhyme 0:d4bbd473a83c 21 extern vt100 *tty ;
Rhyme 0:d4bbd473a83c 22
Rhyme 0:d4bbd473a83c 23 i2c_sensor_type i2c_sensor[] = {
Rhyme 0:d4bbd473a83c 24 {MSU_MMA8451Q_ADDRESS, "MMA8451Q", testMMA8451Q},
Rhyme 0:d4bbd473a83c 25 {MSU_MMA8452Q_ADDRESS, "MMA8452Q", testMMA8452Q},
Rhyme 0:d4bbd473a83c 26 {MSU_MAG3110_ADDRESS, "MAG3110", testMAG3110},
Rhyme 0:d4bbd473a83c 27 {MSU_HIH6130_ADDRESS, "HIH6130", testHIH6130},
Rhyme 0:d4bbd473a83c 28 {MSU_FXOS8700CQ_ADDRESS, "FXOS8700CQ", testFXOS8700CQ},
Rhyme 0:d4bbd473a83c 29 {MSU_MAX44000_ADDRESS, "MAX44000", testMAX44000},
Rhyme 0:d4bbd473a83c 30 {MSU_MAX44005_ADDRESS, "MAX44005", testMAX44005},
Rhyme 0:d4bbd473a83c 31 {MSU_MAX44008_ADDRESS, "MAX44008", testMAX44008},
Rhyme 0:d4bbd473a83c 32 {MSU_MAX30101_ADDRESS, "MAX30101", testMAX30101},
Rhyme 0:d4bbd473a83c 33 {MSU_MPL3115A2_ADDRESS, "MPL3115A2", testMPL3115A2},
Rhyme 0:d4bbd473a83c 34 {MSU_IS31SE5000_ADDRESS, "IS31SE5000", testIS31SE5000},
Rhyme 0:d4bbd473a83c 35 {MSU_VEML6040A_ADDRESS, "VEML6040A", testVEML6040A},
Rhyme 0:d4bbd473a83c 36 {MSU_VEML6075A_ADDRESS, "VEML6075A", testVEML6075A},
Rhyme 3:be01d9e0fa3e 37 {MSU_LM75B_ADDRESS, "LM75B", testLM75B},
Rhyme 0:d4bbd473a83c 38 {0x00, 0, 0}
Rhyme 0:d4bbd473a83c 39 } ;
Rhyme 0:d4bbd473a83c 40
Rhyme 3:be01d9e0fa3e 41 void testLM75B(void)
Rhyme 3:be01d9e0fa3e 42 {
Rhyme 3:be01d9e0fa3e 43 int8_t itemp = 0 ;
Rhyme 3:be01d9e0fa3e 44 float ftemp = 0.0 ;
Rhyme 3:be01d9e0fa3e 45 printf("test LM75B\n") ;
Rhyme 3:be01d9e0fa3e 46 LM75B *lm75b = new LM75B(PIN_SDA, PIN_SCL, MSU_LM75B_ADDRESS) ;
Rhyme 3:be01d9e0fa3e 47 for (int i = 0 ; i < test_loop ; i++ ) {
Rhyme 3:be01d9e0fa3e 48 itemp = lm75b->temp() ;
Rhyme 3:be01d9e0fa3e 49 lm75b->getTemp(&ftemp) ;
Rhyme 3:be01d9e0fa3e 50 printf("Temp = %d C degree, %.3f C degree\n", itemp, ftemp) ;
Rhyme 3:be01d9e0fa3e 51 wait(0.5) ;
Rhyme 3:be01d9e0fa3e 52 }
Rhyme 3:be01d9e0fa3e 53 }
Rhyme 3:be01d9e0fa3e 54
Rhyme 0:d4bbd473a83c 55 void testMMA8451Q(void)
Rhyme 0:d4bbd473a83c 56 {
Rhyme 0:d4bbd473a83c 57 uint16_t ix, iy, iz ;
Rhyme 0:d4bbd473a83c 58 float fx, fy, fz ;
Rhyme 0:d4bbd473a83c 59
Rhyme 0:d4bbd473a83c 60 printf("test MMA8451Q\n") ;
Rhyme 0:d4bbd473a83c 61 MMA8451Q *acc = new MMA8451Q(PIN_SDA, PIN_SCL, MSU_MMA8451Q_ADDRESS) ;
Rhyme 0:d4bbd473a83c 62 for(int i = 0 ; i < test_loop ; i++) {
Rhyme 0:d4bbd473a83c 63 ix = acc->getRawX() ;
Rhyme 0:d4bbd473a83c 64 iy = acc->getRawY() ;
Rhyme 0:d4bbd473a83c 65 iz = acc->getRawZ() ;
Rhyme 0:d4bbd473a83c 66 fx = acc->getAccX() ;
Rhyme 0:d4bbd473a83c 67 fy = acc->getAccY() ;
Rhyme 0:d4bbd473a83c 68 fz = acc->getAccZ() ;
Rhyme 0:d4bbd473a83c 69 printf("X = %d [ %.2f ], Y = %d [ %.2f ], Z = %d [ %.2f ]\n",
Rhyme 0:d4bbd473a83c 70 ix, fx, iy, fy, iz, fz ) ;
Rhyme 0:d4bbd473a83c 71 wait(0.2) ;
Rhyme 0:d4bbd473a83c 72 }
Rhyme 0:d4bbd473a83c 73 delete acc ;
Rhyme 0:d4bbd473a83c 74 }
Rhyme 0:d4bbd473a83c 75
Rhyme 0:d4bbd473a83c 76 void testMMA8452Q(void)
Rhyme 0:d4bbd473a83c 77 {
Rhyme 0:d4bbd473a83c 78 float x, y, z ;
Rhyme 0:d4bbd473a83c 79 printf("test MMA8452Q\n") ;
Rhyme 0:d4bbd473a83c 80 MMA8452Q *acc = new MMA8452Q(PIN_SDA, PIN_SCL, MSU_MMA8452Q_ADDRESS) ;
Rhyme 0:d4bbd473a83c 81 for(int i = 0 ; i < test_loop ; i++) {
Rhyme 0:d4bbd473a83c 82 x = acc->getAccX() ;
Rhyme 0:d4bbd473a83c 83 y = acc->getAccY() ;
Rhyme 0:d4bbd473a83c 84 z = acc->getAccZ() ;
Rhyme 0:d4bbd473a83c 85 printf("X[%.2f] Y[%.2f] Z[%.2f]\n",x, y, z) ;
Rhyme 0:d4bbd473a83c 86 wait(0.1);
Rhyme 0:d4bbd473a83c 87 }
Rhyme 0:d4bbd473a83c 88 delete acc ;
Rhyme 0:d4bbd473a83c 89 }
Rhyme 0:d4bbd473a83c 90
Rhyme 0:d4bbd473a83c 91 void testMAG3110(void)
Rhyme 0:d4bbd473a83c 92 {
Rhyme 0:d4bbd473a83c 93 uint8_t status = 0 ;
Rhyme 0:d4bbd473a83c 94 int16_t mX, mY, mZ ;
Rhyme 0:d4bbd473a83c 95 float fx, fy, fz ;
Rhyme 0:d4bbd473a83c 96 int x = 10 ;
Rhyme 0:d4bbd473a83c 97 int y = 5 ;
Rhyme 0:d4bbd473a83c 98 MAG3110 *mag = new MAG3110(PIN_SDA, PIN_SCL, MSU_MAG3110_ADDRESS) ;
Rhyme 0:d4bbd473a83c 99 mag->activate() ;
Rhyme 0:d4bbd473a83c 100 tty->cls() ;
Rhyme 0:d4bbd473a83c 101 printf("test MAG3110\n") ;
Rhyme 0:d4bbd473a83c 102 for (int i = 0 ; i < test_loop ; i++) {
Rhyme 0:d4bbd473a83c 103 wait(0.01) ;
Rhyme 0:d4bbd473a83c 104 status = mag->getStatus() ;
Rhyme 0:d4bbd473a83c 105 while((status & 0x80) == 0) { // wait for ZYXOW
Rhyme 0:d4bbd473a83c 106 wait(0.01) ;
Rhyme 0:d4bbd473a83c 107 status = mag->getStatus() ;
Rhyme 0:d4bbd473a83c 108 }
Rhyme 0:d4bbd473a83c 109
Rhyme 0:d4bbd473a83c 110 tty->locate(x+5, y) ;
Rhyme 0:d4bbd473a83c 111 printf("--- MAG3110 ---") ;
Rhyme 0:d4bbd473a83c 112 tty->locate(x, y+4) ;
Rhyme 0:d4bbd473a83c 113 printf("Temperature: %02X",mag->getTemp()) ;
Rhyme 0:d4bbd473a83c 114 tty->locate(x, y+5) ;
Rhyme 0:d4bbd473a83c 115 printf("status: 0x%02X",mag->getStatus()) ;
Rhyme 0:d4bbd473a83c 116 tty->locate(x, y+6) ;
Rhyme 0:d4bbd473a83c 117 printf("ctrl reg1: 0x%02X ", mag->getCtrlReg1()) ;
Rhyme 0:d4bbd473a83c 118 printf("reg2: 0x%02X", mag->getCtrlReg2()) ;
Rhyme 0:d4bbd473a83c 119 mX = mag->getX() ; // here reset takes place!
Rhyme 0:d4bbd473a83c 120 mY = mag->getY() ;
Rhyme 0:d4bbd473a83c 121 mZ = mag->getZ() ;
Rhyme 0:d4bbd473a83c 122 fx = 10000 * (float)mX / (float)0x7FFF ;
Rhyme 0:d4bbd473a83c 123 fy = 10000 * (float)mY / (float)0x7FFF ;
Rhyme 0:d4bbd473a83c 124 fz = 10000 * (float)mZ / (float)0x7FFF ;
Rhyme 0:d4bbd473a83c 125 tty->locate(x, y+1) ;
Rhyme 0:d4bbd473a83c 126 printf("X : ") ;
Rhyme 0:d4bbd473a83c 127 if (fx >= 0) { printf(" ") ; }
Rhyme 0:d4bbd473a83c 128 printf("%.2f uT : 0x%08X ", fx, mX) ;
Rhyme 0:d4bbd473a83c 129
Rhyme 0:d4bbd473a83c 130 tty->locate(x, y+2) ;
Rhyme 0:d4bbd473a83c 131 printf("Y : ") ;
Rhyme 0:d4bbd473a83c 132 if (fy >= 0) { printf(" ") ; }
Rhyme 0:d4bbd473a83c 133 printf("%.2f uT : 0x%08X ", fy, mY) ;
Rhyme 0:d4bbd473a83c 134
Rhyme 0:d4bbd473a83c 135 tty->locate(x, y+3) ;
Rhyme 0:d4bbd473a83c 136 printf("Z : ") ;
Rhyme 0:d4bbd473a83c 137 if (fz >= 0) { printf(" ") ; }
Rhyme 0:d4bbd473a83c 138 printf("%.2f uT : 0x%08X ", fz, mZ) ;
Rhyme 0:d4bbd473a83c 139 }
Rhyme 0:d4bbd473a83c 140 tty->locate(0, 20) ;
Rhyme 0:d4bbd473a83c 141 mag->standby() ;
Rhyme 0:d4bbd473a83c 142 delete mag ;
Rhyme 0:d4bbd473a83c 143 }
Rhyme 0:d4bbd473a83c 144
Rhyme 0:d4bbd473a83c 145 void testHIH6130(void)
Rhyme 0:d4bbd473a83c 146 {
Rhyme 0:d4bbd473a83c 147 uint16_t result = 0 ;
Rhyme 0:d4bbd473a83c 148 float humidity = 0 ;
Rhyme 0:d4bbd473a83c 149 float temperature = 0 ;
Rhyme 0:d4bbd473a83c 150 HIH6130 *hih = new HIH6130(PIN_SDA, PIN_SCL, MSU_HIH6130_ADDRESS) ;
Rhyme 0:d4bbd473a83c 151 printf("test HIH6130\n") ;
Rhyme 0:d4bbd473a83c 152 for (int i = 0 ; i < test_loop ; i++) {
Rhyme 0:d4bbd473a83c 153 result = hih->getValue(&humidity, &temperature) ;
Rhyme 0:d4bbd473a83c 154 printf("Temp %.1f C Humidity %.1f %%\n", temperature, humidity) ;
Rhyme 0:d4bbd473a83c 155 wait(1) ;
Rhyme 0:d4bbd473a83c 156 }
Rhyme 0:d4bbd473a83c 157 }
Rhyme 0:d4bbd473a83c 158
Rhyme 0:d4bbd473a83c 159 void testFXOS8700CQ(void)
Rhyme 0:d4bbd473a83c 160 {
Rhyme 0:d4bbd473a83c 161 int16_t accData[3], mgnData[3] ;
Rhyme 0:d4bbd473a83c 162
Rhyme 0:d4bbd473a83c 163 printf("test FXOS8700CQ\n") ;
Rhyme 0:d4bbd473a83c 164 FXOS8700CQ *fxos = new FXOS8700CQ(PIN_SDA, PIN_SCL, MSU_FXOS8700CQ_ADDRESS) ;
Rhyme 0:d4bbd473a83c 165 fxos->init() ;
Rhyme 0:d4bbd473a83c 166
Rhyme 0:d4bbd473a83c 167 for (int i = 0 ; i < test_loop ; i++) {
Rhyme 0:d4bbd473a83c 168 fxos->readAccMgnData(accData, mgnData) ;
Rhyme 0:d4bbd473a83c 169 printf("ACC X[%d], Y[%d], Z[%d], MGN X[%d], Y[%d], Z[%d]\n",
Rhyme 0:d4bbd473a83c 170 accData[0], accData[1], accData[2],
Rhyme 0:d4bbd473a83c 171 mgnData[0], mgnData[1], mgnData[2]) ;
Rhyme 0:d4bbd473a83c 172 wait(0.2) ;
Rhyme 0:d4bbd473a83c 173 }
Rhyme 0:d4bbd473a83c 174 delete fxos ;
Rhyme 0:d4bbd473a83c 175 }
Rhyme 0:d4bbd473a83c 176
Rhyme 1:9450e20cf688 177 void testMAX44000(void)
Rhyme 1:9450e20cf688 178 {
Rhyme 1:9450e20cf688 179 uint8_t mode ;
Rhyme 1:9450e20cf688 180 uint8_t txdata, rxdata ;
Rhyme 1:9450e20cf688 181 uint16_t als ;
Rhyme 1:9450e20cf688 182 uint8_t prox, overflow ;
Rhyme 1:9450e20cf688 183 int x = 10 ;
Rhyme 1:9450e20cf688 184 int y = 5 ;
Rhyme 1:9450e20cf688 185
Rhyme 1:9450e20cf688 186 tty->cls() ;
Rhyme 1:9450e20cf688 187 printf("test MAX44000\n") ;
Rhyme 1:9450e20cf688 188 MAX44000 *max44000 = new MAX44000(PIN_SDA, PIN_SCL, MSU_MAX44000_ADDRESS) ;
Rhyme 1:9450e20cf688 189
Rhyme 1:9450e20cf688 190 rxdata = 0xF1 ;
Rhyme 1:9450e20cf688 191 max44000->setRxConfig(rxdata) ;
Rhyme 1:9450e20cf688 192 txdata = 0x00 ;
Rhyme 1:9450e20cf688 193 max44000->setTxConfig(txdata) ;
Rhyme 1:9450e20cf688 194 mode = 0x24 ;
Rhyme 1:9450e20cf688 195 max44000->setMainConfig(mode) ;
Rhyme 1:9450e20cf688 196
Rhyme 1:9450e20cf688 197 for (int i = 0 ; i < test_loop ; i++ ) {
Rhyme 1:9450e20cf688 198 max44000->getADC(&overflow, &als, &prox) ;
Rhyme 1:9450e20cf688 199 printf("ALS[ %04X ]", als) ;
Rhyme 1:9450e20cf688 200 if (overflow) {
Rhyme 5:cdac8329b22c 201 printf(" overflow ") ;
Rhyme 1:9450e20cf688 202 } else {
Rhyme 5:cdac8329b22c 203 printf(" ") ;
Rhyme 1:9450e20cf688 204 }
Rhyme 5:cdac8329b22c 205 printf("PRX[ %02X ]\n", prox) ;
Rhyme 1:9450e20cf688 206 wait(1) ;
Rhyme 1:9450e20cf688 207 }
Rhyme 1:9450e20cf688 208 delete max44000 ;
Rhyme 1:9450e20cf688 209 }
Rhyme 1:9450e20cf688 210
Rhyme 1:9450e20cf688 211 void testMAX44005(void)
Rhyme 1:9450e20cf688 212 {
Rhyme 1:9450e20cf688 213 uint16_t amb_c, amb_r, amb_g, amb_b, amb_ir, amb_ircomp, amb_temp ;
Rhyme 1:9450e20cf688 214 MAX44005 *max44005 = new MAX44005(PIN_SDA, PIN_SCL, MSU_MAX44005_ADDRESS) ;
Rhyme 1:9450e20cf688 215 max44005->enableTEMP() ;
Rhyme 1:9450e20cf688 216 max44005->setMode(0x04) ;
Rhyme 1:9450e20cf688 217 printf("test MAX44005\n") ;
Rhyme 1:9450e20cf688 218
Rhyme 1:9450e20cf688 219 for (int i = 0 ; i < test_loop ; i++ ) {
Rhyme 1:9450e20cf688 220 amb_c = max44005->getAMB_CLEAR() ;
Rhyme 1:9450e20cf688 221 amb_r = max44005->getAMB_RED() ;
Rhyme 1:9450e20cf688 222 amb_g = max44005->getAMB_GREEN() ;
Rhyme 1:9450e20cf688 223 amb_b = max44005->getAMB_BLUE() ;
Rhyme 1:9450e20cf688 224 amb_ir = max44005->getIR() ;
Rhyme 1:9450e20cf688 225 amb_ircomp = max44005->getIRCOMP() ;
Rhyme 1:9450e20cf688 226 amb_temp = max44005->getTEMP() ;
Rhyme 1:9450e20cf688 227 printf("--- MAX44005 ---\n") ;
Rhyme 1:9450e20cf688 228 printf(" C[ %04X ]\n", amb_c) ;
Rhyme 1:9450e20cf688 229 printf("R[ %04X ] G[ %04X ] B[ %04X ]\n",amb_r, amb_g, amb_b) ;
Rhyme 1:9450e20cf688 230 printf("IR[ %04X ] IRCOMP [ %04X ]\n",amb_ir, amb_ircomp) ;
Rhyme 1:9450e20cf688 231 printf(" TEMP [ %04X ]\n",amb_temp) ;
Rhyme 1:9450e20cf688 232 printf("\n") ;
Rhyme 1:9450e20cf688 233 wait(1) ;
Rhyme 1:9450e20cf688 234 }
Rhyme 1:9450e20cf688 235 delete max44005 ;
Rhyme 1:9450e20cf688 236 }
Rhyme 1:9450e20cf688 237
Rhyme 1:9450e20cf688 238 #define MODE_CLEAR_RGB_IR 0x02
Rhyme 1:9450e20cf688 239 void testMAX44008(void)
Rhyme 1:9450e20cf688 240 {
Rhyme 1:9450e20cf688 241 uint16_t amb_c, amb_r, amb_g, amb_b, amb_ir, amb_ircomp, amb_temp ;
Rhyme 1:9450e20cf688 242
Rhyme 1:9450e20cf688 243 MAX44008 *max44008 = new MAX44008(PIN_SDA, PIN_SCL, MSU_MAX44008_ADDRESS) ;
Rhyme 1:9450e20cf688 244 max44008->setMode(MODE_CLEAR_RGB_IR) ;
Rhyme 1:9450e20cf688 245 printf("test MAX44008\n") ;
Rhyme 1:9450e20cf688 246
Rhyme 1:9450e20cf688 247 for (int i = 0 ; i < test_loop ; i++ ) {
Rhyme 1:9450e20cf688 248 amb_c = max44008->getAMB_CLEAR() ;
Rhyme 1:9450e20cf688 249 amb_r = max44008->getAMB_RED() ;
Rhyme 1:9450e20cf688 250 amb_g = max44008->getAMB_GREEN() ;
Rhyme 1:9450e20cf688 251 amb_b = max44008->getAMB_BLUE() ;
Rhyme 1:9450e20cf688 252 amb_ir = max44008->getIR() ;
Rhyme 1:9450e20cf688 253 amb_ircomp = max44008->getIRCOMP() ;
Rhyme 1:9450e20cf688 254 amb_temp = max44008->getTEMP() ;
Rhyme 1:9450e20cf688 255 printf("--- MAX44008 ---\n") ;
Rhyme 1:9450e20cf688 256 printf(" C[ %04X ]\n", amb_c) ;
Rhyme 1:9450e20cf688 257 printf("R[ %04X ] G[ %04X ] B[ %04X ]\n",amb_r, amb_g, amb_b) ;
Rhyme 1:9450e20cf688 258 printf("IR[ %04X ] IRCOMP [ %04X ]\n",amb_ir, amb_ircomp) ;
Rhyme 1:9450e20cf688 259 printf(" TEMP [ %04X ]\n",amb_temp) ;
Rhyme 1:9450e20cf688 260 printf("\n") ;
Rhyme 1:9450e20cf688 261 wait(1) ;
Rhyme 1:9450e20cf688 262 }
Rhyme 1:9450e20cf688 263 delete max44008 ;
Rhyme 1:9450e20cf688 264 }
Rhyme 1:9450e20cf688 265
Rhyme 1:9450e20cf688 266 void testMAX30101(void)
Rhyme 1:9450e20cf688 267 {
Rhyme 1:9450e20cf688 268 printf("test MAX30101\n") ;
Rhyme 1:9450e20cf688 269 printf("Sorry not implemented yet\n") ;
Rhyme 1:9450e20cf688 270 }
Rhyme 1:9450e20cf688 271
Rhyme 1:9450e20cf688 272 void testMPL3115A2(void)
Rhyme 1:9450e20cf688 273 {
Rhyme 1:9450e20cf688 274 uint32_t data, alt, bar, tmp ;
Rhyme 1:9450e20cf688 275 uint16_t sample_time ;
Rhyme 1:9450e20cf688 276 MPL3115A2 *mpl = new MPL3115A2(PIN_SDA, PIN_SCL, MSU_MPL3115A2_ADDRESS) ;
Rhyme 1:9450e20cf688 277
Rhyme 1:9450e20cf688 278 printf("test MPL3115A2\n") ;
Rhyme 1:9450e20cf688 279 for (int i = 0 ; i < test_loop ; i++) {
Rhyme 1:9450e20cf688 280 mpl->modeAlt() ;
Rhyme 1:9450e20cf688 281 sample_time = mpl->OneShot() ;
Rhyme 1:9450e20cf688 282 wait(((double)sample_time)/1000.0) ;
Rhyme 1:9450e20cf688 283 alt = mpl->getAltitude() ;
Rhyme 1:9450e20cf688 284 mpl->modeBar() ;
Rhyme 1:9450e20cf688 285 sample_time = mpl->OneShot() ;
Rhyme 1:9450e20cf688 286 wait(((double)sample_time)/1000.0) ;
Rhyme 1:9450e20cf688 287 bar = mpl->getPressure() ;
Rhyme 1:9450e20cf688 288 tmp = mpl->getTemperature() ;
Rhyme 1:9450e20cf688 289 printf("Altitude: %d, Pressure: %d, Temperature: %d\n",
Rhyme 1:9450e20cf688 290 (alt >> 16)&0xFFFF,
Rhyme 1:9450e20cf688 291 (bar >> 6),
Rhyme 1:9450e20cf688 292 (tmp >> 8) ) ;
Rhyme 1:9450e20cf688 293 wait(1) ;
Rhyme 1:9450e20cf688 294 }
Rhyme 1:9450e20cf688 295 delete mpl ;
Rhyme 1:9450e20cf688 296 }
Rhyme 1:9450e20cf688 297
Rhyme 1:9450e20cf688 298 void testIS31SE5000(void)
Rhyme 1:9450e20cf688 299 {
Rhyme 1:9450e20cf688 300 printf("test ISI31SE5000\n") ;
Rhyme 1:9450e20cf688 301 printf("Sorry not implemented yet\n") ;
Rhyme 1:9450e20cf688 302 }
Rhyme 1:9450e20cf688 303
Rhyme 1:9450e20cf688 304 void testVEML6040A(void)
Rhyme 1:9450e20cf688 305 {
Rhyme 1:9450e20cf688 306 printf("test VEML6040A\n") ;
Rhyme 1:9450e20cf688 307 printf("Sorry not implemented yet\n") ;
Rhyme 1:9450e20cf688 308 }
Rhyme 1:9450e20cf688 309
Rhyme 1:9450e20cf688 310 void testVEML6075A(void)
Rhyme 1:9450e20cf688 311 {
Rhyme 1:9450e20cf688 312 printf("test VEML6075A\n") ;
Rhyme 1:9450e20cf688 313 printf("Sorry not implemented yet\n") ;
Rhyme 1:9450e20cf688 314 }