uses BBC micro:bit to measure and display indoor air quality using Bosch BME680 and/or Sensirion SGP30

Dependencies:   microbit

uses Bosch BME680 and/or Sensirion SGP30 sensors to measure indor air quality

sensors should be connected to BBC micro:bit using i2c

commands are received and data is being sent using uBit / nordic radio protocol

display ---

last line always indicates: - first dot: bme680 detected - second dot: sgp30 detected - third dot: sgp 30 setting humidity/temperature - fourth dor: sgp30 measuring - fith dot: bme680 measuring

the detect dots should be in a stable state (not blinking) the measuring dots should be blinking (constant light means: measurement failed)

if only one bme680 is present: - first 3 lines indicate gas resistence (air quality / more dots == worse quality) - fourth line indicates humidity level

if only sgp30 is present: - first two lines indicate SGP30 VOC level - third and fourth line indicate sgp30 CO2 level

if both sensors are present: - first line indicates SGP30 VOC level - second line line indicates sgp30 CO2 level - third line indicates bme680 gas resistence (air quality) - fourth line indicates bme 680 humidity level

buttons - B display state, switches betweeen - full bright - low light - display off

AB reset sgp30 baseline in non volatile storage

data logging -- during measurements the minimum and mximum values for each measured value (temperature, air pressure, humidity,gas resistance, VOC, CO2) are being stored in non volatile storage those (and the last measurement results) are being shown when btn A has been pressed

Committer:
jsa1969
Date:
Fri Dec 14 14:26:04 2018 +0000
Revision:
27:cb75a0c5c52a
Parent:
24:07a1d2e6914e
Child:
28:56273b8282ca
store bme680 gas resistance indexed by humidity

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jsa1969 0:cef60cc92da0 1 /*
jsa1969 0:cef60cc92da0 2 The MIT License (MIT)
jsa1969 0:cef60cc92da0 3
jsa1969 0:cef60cc92da0 4 Copyright (c) 2016 British Broadcasting Corporation.
jsa1969 0:cef60cc92da0 5 This software is provided by Lancaster University by arrangement with the BBC.
jsa1969 0:cef60cc92da0 6
jsa1969 0:cef60cc92da0 7 Permission is hereby granted, free of charge, to any person obtaining a
jsa1969 0:cef60cc92da0 8 copy of this software and associated documentation files (the "Software"),
jsa1969 0:cef60cc92da0 9 to deal in the Software without restriction, including without limitation
jsa1969 0:cef60cc92da0 10 the rights to use, copy, modify, merge, publish, distribute, sublicense,
jsa1969 0:cef60cc92da0 11 and/or sell copies of the Software, and to permit persons to whom the
jsa1969 0:cef60cc92da0 12 Software is furnished to do so, subject to the following conditions:
jsa1969 0:cef60cc92da0 13
jsa1969 0:cef60cc92da0 14 The above copyright notice and this permission notice shall be included in
jsa1969 0:cef60cc92da0 15 all copies or substantial portions of the Software.
jsa1969 0:cef60cc92da0 16
jsa1969 0:cef60cc92da0 17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jsa1969 0:cef60cc92da0 18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jsa1969 0:cef60cc92da0 19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
jsa1969 0:cef60cc92da0 20 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jsa1969 0:cef60cc92da0 21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
jsa1969 0:cef60cc92da0 22 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
jsa1969 0:cef60cc92da0 23 DEALINGS IN THE SOFTWARE.
jsa1969 0:cef60cc92da0 24 */
jsa1969 0:cef60cc92da0 25
jsa1969 0:cef60cc92da0 26 #include "MicroBit.h"
jsa1969 0:cef60cc92da0 27
jsa1969 0:cef60cc92da0 28 #include "bme680.h"
jsa1969 2:544117df8c65 29 #include "sgp30.h"
jsa1969 2:544117df8c65 30 #include "dotmath.h"
jsa1969 11:6844a5578b4f 31 #include "nvstore.h"
jsa1969 2:544117df8c65 32
jsa1969 1:f9245fb53737 33 #include "physics.h"
jsa1969 0:cef60cc92da0 34
jsa1969 0:cef60cc92da0 35 MicroBit uBit;
jsa1969 2:544117df8c65 36 Bme680* bme680 = NULL;
jsa1969 2:544117df8c65 37 struct bme680_field_data* bme680Data = NULL;
jsa1969 2:544117df8c65 38 Sgp30* sgp30 = NULL;
jsa1969 12:96eb06e837f4 39 I2cCallbacks* callbacks = NULL;
jsa1969 12:96eb06e837f4 40 NvStore* nvStore = NULL;
jsa1969 12:96eb06e837f4 41
jsa1969 12:96eb06e837f4 42 bool cancelMeasureLoops = false;
jsa1969 12:96eb06e837f4 43 int runningLoops = 0;
jsa1969 20:2f11b93f4cbf 44 int displayState = 0;
jsa1969 0:cef60cc92da0 45
jsa1969 12:96eb06e837f4 46 void waitForLooppsToFinish() {
jsa1969 12:96eb06e837f4 47 cancelMeasureLoops=true;
jsa1969 12:96eb06e837f4 48 while (runningLoops>0) {
jsa1969 12:96eb06e837f4 49 uBit.sleep(10);
jsa1969 12:96eb06e837f4 50 }
jsa1969 12:96eb06e837f4 51 cancelMeasureLoops = false;
jsa1969 12:96eb06e837f4 52 }
jsa1969 0:cef60cc92da0 53
jsa1969 11:6844a5578b4f 54 void displayPixels(int ystart, int pixels, int maxpixels) {
jsa1969 11:6844a5578b4f 55 int y = ystart;
jsa1969 11:6844a5578b4f 56 for (int i=0; i+((y-ystart)*5)<maxpixels; ++i) {
jsa1969 11:6844a5578b4f 57 if (i==5) {
jsa1969 11:6844a5578b4f 58 ++y;
jsa1969 11:6844a5578b4f 59 i=0;
jsa1969 11:6844a5578b4f 60 }
jsa1969 11:6844a5578b4f 61 int pixelsused = i+((y-ystart)*5);
jsa1969 11:6844a5578b4f 62 uBit.display.image.setPixelValue(i, y, pixelsused<pixels? 255 : 0);
jsa1969 10:8e6b71a46871 63 }
jsa1969 10:8e6b71a46871 64 }
jsa1969 10:8e6b71a46871 65
jsa1969 1:f9245fb53737 66 int measureBme680(){
jsa1969 1:f9245fb53737 67 if (bme680!=NULL && bme680Data!=NULL) {
jsa1969 1:f9245fb53737 68 return bme680->measure(
jsa1969 1:f9245fb53737 69 bme680Data,
jsa1969 2:544117df8c65 70 bme680Data->temperature==0 ?
jsa1969 2:544117df8c65 71 uBit.thermometer.getTemperature()
jsa1969 2:544117df8c65 72 :bme680Data->temperature,
jsa1969 12:96eb06e837f4 73 2000, 250);
jsa1969 1:f9245fb53737 74 } else {
jsa1969 1:f9245fb53737 75 return BME680_E_DEV_NOT_FOUND;
jsa1969 1:f9245fb53737 76 }
jsa1969 0:cef60cc92da0 77 }
jsa1969 0:cef60cc92da0 78
jsa1969 11:6844a5578b4f 79 void measureAndDisplayBme680() {
jsa1969 11:6844a5578b4f 80 if (bme680!=NULL) {
jsa1969 11:6844a5578b4f 81 uBit.display.image.setPixelValue(4, 4, 255);
jsa1969 11:6844a5578b4f 82 if (measureBme680()==MICROBIT_OK) {
jsa1969 27:cb75a0c5c52a 83 nvStore->updateGas(bme680Data->gas_resistance, bme680Data->humidity);
jsa1969 17:a2c4dd192146 84 nvStore->updateTemp(bme680Data->temperature);
jsa1969 17:a2c4dd192146 85 nvStore->updatePress(bme680Data->pressure);
jsa1969 17:a2c4dd192146 86 nvStore->updateHumidity(bme680Data->humidity);
jsa1969 17:a2c4dd192146 87
jsa1969 14:71060505061e 88 uBit.display.image.setPixelValue(0, 4, 255);
jsa1969 11:6844a5578b4f 89 uBit.display.image.setPixelValue(4, 4, 0);
jsa1969 11:6844a5578b4f 90 int bmeY = sgp30!=NULL ? 2 : 0;
jsa1969 11:6844a5578b4f 91 int bmeMaxPixels = sgp30!=NULL ? 5 : 15;
jsa1969 27:cb75a0c5c52a 92 displayPixels(bmeY, DotMath::pixels(bme680Data->gas_resistance, nvStore->getGasMax(bme680Data->humidity), bmeMaxPixels),
jsa1969 11:6844a5578b4f 93 bmeMaxPixels);
jsa1969 11:6844a5578b4f 94 displayPixels(3, 5*bme680Data->humidity/100000, 5);
jsa1969 14:71060505061e 95 } else {
jsa1969 14:71060505061e 96 uBit.display.image.setPixelValue(0, 4, 0);
jsa1969 2:544117df8c65 97 }
jsa1969 12:96eb06e837f4 98 uBit.display.image.setPixelValue(4, 4, 0);
jsa1969 11:6844a5578b4f 99 }
jsa1969 11:6844a5578b4f 100 }
jsa1969 11:6844a5578b4f 101
jsa1969 11:6844a5578b4f 102 void measureAndDisplaySgp30() {
jsa1969 11:6844a5578b4f 103 if (sgp30!=NULL) {
jsa1969 11:6844a5578b4f 104 int sgpMaxPixels = 10;
jsa1969 11:6844a5578b4f 105 int secondLineStart = 2;
jsa1969 11:6844a5578b4f 106 if (bme680!=NULL) {
jsa1969 11:6844a5578b4f 107 sgpMaxPixels = 5;
jsa1969 11:6844a5578b4f 108 secondLineStart = 1;
jsa1969 11:6844a5578b4f 109 uBit.display.image.setPixelValue(2, 4, 255);
jsa1969 11:6844a5578b4f 110 if (sgp30->setHumidity(bme680Data->humidity, bme680Data->temperature)) {
jsa1969 11:6844a5578b4f 111 uBit.display.image.setPixelValue(2, 4, 0);
jsa1969 11:6844a5578b4f 112 }
jsa1969 11:6844a5578b4f 113 uBit.sleep(10);
jsa1969 11:6844a5578b4f 114 }
jsa1969 11:6844a5578b4f 115 uBit.display.image.setPixelValue(3, 4, 255);
jsa1969 11:6844a5578b4f 116 if (sgp30->IAQmeasure()) {
jsa1969 13:996026828be7 117 uBit.display.image.setPixelValue(1, 4, 255);
jsa1969 11:6844a5578b4f 118 uBit.display.image.setPixelValue(3, 4, 0);
jsa1969 18:c4ac93e01027 119
jsa1969 18:c4ac93e01027 120 nvStore->updateVoc(sgp30->TVOC);
jsa1969 18:c4ac93e01027 121 nvStore->updateCo(sgp30->eCO2);
jsa1969 18:c4ac93e01027 122
jsa1969 12:96eb06e837f4 123 int co2Dots = min (5, sgp30->eCO2 /1500);
jsa1969 11:6844a5578b4f 124 displayPixels(0, 5 - DotMath::pixels(sgp30->TVOC, 20000, sgpMaxPixels), sgpMaxPixels);
jsa1969 11:6844a5578b4f 125 displayPixels(secondLineStart, co2Dots, sgpMaxPixels);
jsa1969 13:996026828be7 126 } else {
jsa1969 13:996026828be7 127 uBit.display.image.setPixelValue(1, 4, 0);
jsa1969 11:6844a5578b4f 128 }
jsa1969 2:544117df8c65 129 }
jsa1969 2:544117df8c65 130 }
jsa1969 2:544117df8c65 131
jsa1969 12:96eb06e837f4 132 void bmeMeasureLoop() {
jsa1969 12:96eb06e837f4 133 if (bme680!=NULL) {
jsa1969 12:96eb06e837f4 134 ++runningLoops;
jsa1969 12:96eb06e837f4 135 while (!cancelMeasureLoops){
jsa1969 11:6844a5578b4f 136 measureAndDisplayBme680();
jsa1969 13:996026828be7 137 uBit.sleep(500);
jsa1969 12:96eb06e837f4 138 }
jsa1969 12:96eb06e837f4 139 --runningLoops;
jsa1969 12:96eb06e837f4 140 }
jsa1969 24:07a1d2e6914e 141 release_fiber();
jsa1969 12:96eb06e837f4 142 }
jsa1969 12:96eb06e837f4 143
jsa1969 12:96eb06e837f4 144 void sgpMeasureLoop() {
jsa1969 12:96eb06e837f4 145 if (sgp30!=NULL) {
jsa1969 12:96eb06e837f4 146 ++runningLoops;
jsa1969 12:96eb06e837f4 147 while (!cancelMeasureLoops){
jsa1969 11:6844a5578b4f 148 measureAndDisplaySgp30();
jsa1969 12:96eb06e837f4 149 uBit.sleep(950);
jsa1969 2:544117df8c65 150 }
jsa1969 12:96eb06e837f4 151 --runningLoops;
jsa1969 2:544117df8c65 152 }
jsa1969 24:07a1d2e6914e 153 release_fiber();
jsa1969 12:96eb06e837f4 154 }
jsa1969 12:96eb06e837f4 155
jsa1969 12:96eb06e837f4 156 void startLoops() {
jsa1969 12:96eb06e837f4 157 if (runningLoops>0) {
jsa1969 12:96eb06e837f4 158 uBit.display.scroll("already running");
jsa1969 12:96eb06e837f4 159 return;
jsa1969 12:96eb06e837f4 160 }
jsa1969 14:71060505061e 161 create_fiber(sgpMeasureLoop);
jsa1969 12:96eb06e837f4 162 create_fiber(bmeMeasureLoop);
jsa1969 2:544117df8c65 163 }
jsa1969 2:544117df8c65 164
jsa1969 11:6844a5578b4f 165 void init680(){
jsa1969 9:5150afa50eb6 166 if (bme680!=NULL){
jsa1969 9:5150afa50eb6 167 delete bme680;
jsa1969 9:5150afa50eb6 168 }
jsa1969 10:8e6b71a46871 169
jsa1969 27:cb75a0c5c52a 170 uint32_t gasMax = nvStore->getGasMax(0);
jsa1969 11:6844a5578b4f 171 if (gasMax>0) {
jsa1969 11:6844a5578b4f 172 uBit.display.scroll((int)gasMax);
jsa1969 11:6844a5578b4f 173 }
jsa1969 10:8e6b71a46871 174
jsa1969 14:71060505061e 175 bme680 = new Bme680(callbacks);
jsa1969 9:5150afa50eb6 176 int code = bme680->init();
jsa1969 9:5150afa50eb6 177 if (code == MICROBIT_OK){
jsa1969 9:5150afa50eb6 178 if (bme680Data==NULL) {
jsa1969 9:5150afa50eb6 179 bme680Data = new struct bme680_field_data;
jsa1969 9:5150afa50eb6 180 }
jsa1969 9:5150afa50eb6 181 code = bme680->measure(
jsa1969 9:5150afa50eb6 182 bme680Data,
jsa1969 9:5150afa50eb6 183 uBit.thermometer.getTemperature(),
jsa1969 9:5150afa50eb6 184 100, 100);
jsa1969 9:5150afa50eb6 185 }
jsa1969 9:5150afa50eb6 186 if (code != MICROBIT_OK){
jsa1969 9:5150afa50eb6 187 delete bme680;
jsa1969 9:5150afa50eb6 188 bme680 = NULL;
jsa1969 9:5150afa50eb6 189 delete bme680Data;
jsa1969 9:5150afa50eb6 190 bme680Data = NULL;
jsa1969 9:5150afa50eb6 191 uBit.display.scroll(code);
jsa1969 9:5150afa50eb6 192 } else {
jsa1969 9:5150afa50eb6 193 uBit.display.image.setPixelValue(0, 4, 255);
jsa1969 9:5150afa50eb6 194 }
jsa1969 11:6844a5578b4f 195 }
jsa1969 9:5150afa50eb6 196
jsa1969 11:6844a5578b4f 197 void initSgp30(){
jsa1969 9:5150afa50eb6 198 if (sgp30!=NULL){
jsa1969 9:5150afa50eb6 199 delete sgp30;
jsa1969 9:5150afa50eb6 200 }
jsa1969 9:5150afa50eb6 201 sgp30 = new Sgp30(callbacks);
jsa1969 9:5150afa50eb6 202 if (sgp30->test() && sgp30->begin()) {
jsa1969 9:5150afa50eb6 203 uBit.display.image.setPixelValue(1, 4, 255);
jsa1969 9:5150afa50eb6 204 } else {
jsa1969 9:5150afa50eb6 205 delete sgp30;
jsa1969 9:5150afa50eb6 206 sgp30 = NULL;
jsa1969 11:6844a5578b4f 207 }}
jsa1969 11:6844a5578b4f 208
jsa1969 11:6844a5578b4f 209 void initSensors() {
jsa1969 12:96eb06e837f4 210 waitForLooppsToFinish();
jsa1969 11:6844a5578b4f 211 init680();
jsa1969 11:6844a5578b4f 212 initSgp30();
jsa1969 9:5150afa50eb6 213 }
jsa1969 9:5150afa50eb6 214
jsa1969 12:96eb06e837f4 215 void displayValuesTxt() {
jsa1969 12:96eb06e837f4 216 waitForLooppsToFinish();
jsa1969 8:1bdb50e03d39 217 if (bme680Data!=NULL) {
jsa1969 8:1bdb50e03d39 218 uBit.display.scroll("g");
jsa1969 8:1bdb50e03d39 219 uBit.display.scroll((int)bme680Data->gas_resistance);
jsa1969 8:1bdb50e03d39 220 uBit.display.scroll("+");
jsa1969 27:cb75a0c5c52a 221 uBit.display.scroll((int)nvStore->getGasMax(bme680Data->humidity));
jsa1969 14:71060505061e 222 uBit.display.scroll("-");
jsa1969 14:71060505061e 223 uBit.display.scroll((int)nvStore->getGasMin());
jsa1969 17:a2c4dd192146 224 uBit.display.scroll("t");
jsa1969 17:a2c4dd192146 225 uBit.display.scroll((int)bme680Data->temperature);
jsa1969 17:a2c4dd192146 226 uBit.display.scroll("+");
jsa1969 17:a2c4dd192146 227 uBit.display.scroll((int)nvStore->getTempMax());
jsa1969 17:a2c4dd192146 228 uBit.display.scroll("-");
jsa1969 17:a2c4dd192146 229 uBit.display.scroll((int)nvStore->getTempMin());
jsa1969 17:a2c4dd192146 230 uBit.display.scroll("p");
jsa1969 17:a2c4dd192146 231 uBit.display.scroll((int)bme680Data->pressure);
jsa1969 17:a2c4dd192146 232 uBit.display.scroll("+");
jsa1969 17:a2c4dd192146 233 uBit.display.scroll((int)nvStore->getPressMax());
jsa1969 17:a2c4dd192146 234 uBit.display.scroll("-");
jsa1969 17:a2c4dd192146 235 uBit.display.scroll((int)nvStore->getPressMin());
jsa1969 17:a2c4dd192146 236 uBit.display.scroll("h");
jsa1969 17:a2c4dd192146 237 uBit.display.scroll((int)bme680Data->humidity);
jsa1969 17:a2c4dd192146 238 uBit.display.scroll("+");
jsa1969 17:a2c4dd192146 239 uBit.display.scroll((int)nvStore->getHumMax());
jsa1969 17:a2c4dd192146 240 uBit.display.scroll("-");
jsa1969 17:a2c4dd192146 241 uBit.display.scroll((int)nvStore->getHumMin());
jsa1969 8:1bdb50e03d39 242 }
jsa1969 17:a2c4dd192146 243
jsa1969 8:1bdb50e03d39 244 if (sgp30!=NULL) {
jsa1969 8:1bdb50e03d39 245 uBit.display.scroll("v");
jsa1969 8:1bdb50e03d39 246 uBit.display.scroll((int)sgp30->TVOC);
jsa1969 18:c4ac93e01027 247 uBit.display.scroll("+");
jsa1969 18:c4ac93e01027 248 uBit.display.scroll((int)nvStore->getVocMax());
jsa1969 18:c4ac93e01027 249 uBit.display.scroll("-");
jsa1969 18:c4ac93e01027 250 uBit.display.scroll((int)nvStore->getVocMin());
jsa1969 8:1bdb50e03d39 251 uBit.display.scroll("c");
jsa1969 8:1bdb50e03d39 252 uBit.display.scroll((int)sgp30->eCO2);
jsa1969 18:c4ac93e01027 253 uBit.display.scroll("+");
jsa1969 18:c4ac93e01027 254 uBit.display.scroll((int)nvStore->getCoMax());
jsa1969 18:c4ac93e01027 255 uBit.display.scroll("-");
jsa1969 18:c4ac93e01027 256 uBit.display.scroll((int)nvStore->getCoMin());
jsa1969 8:1bdb50e03d39 257 }
jsa1969 0:cef60cc92da0 258 }
jsa1969 0:cef60cc92da0 259
jsa1969 12:96eb06e837f4 260 void onButtonA(MicroBitEvent evt)
jsa1969 12:96eb06e837f4 261 {
jsa1969 12:96eb06e837f4 262 if (runningLoops>0) {
jsa1969 12:96eb06e837f4 263 displayValuesTxt();
jsa1969 12:96eb06e837f4 264 } else {
jsa1969 12:96eb06e837f4 265 startLoops();
jsa1969 12:96eb06e837f4 266 }
jsa1969 12:96eb06e837f4 267 }
jsa1969 12:96eb06e837f4 268
jsa1969 12:96eb06e837f4 269 void onButtonB(MicroBitEvent evt)
jsa1969 12:96eb06e837f4 270 {
jsa1969 20:2f11b93f4cbf 271 //initSensors();
jsa1969 20:2f11b93f4cbf 272 switch (++displayState) {
jsa1969 20:2f11b93f4cbf 273 case 1:
jsa1969 20:2f11b93f4cbf 274 uBit.display.setBrightness(5);
jsa1969 20:2f11b93f4cbf 275 break;
jsa1969 20:2f11b93f4cbf 276 case 2:
jsa1969 20:2f11b93f4cbf 277 uBit.display.disable();
jsa1969 20:2f11b93f4cbf 278 break;
jsa1969 20:2f11b93f4cbf 279 default:
jsa1969 20:2f11b93f4cbf 280 uBit.display.setBrightness(255);
jsa1969 20:2f11b93f4cbf 281 uBit.display.enable();
jsa1969 20:2f11b93f4cbf 282 displayState = 0;
jsa1969 20:2f11b93f4cbf 283 }
jsa1969 12:96eb06e837f4 284 }
jsa1969 12:96eb06e837f4 285
jsa1969 9:5150afa50eb6 286 void onButtonAB(MicroBitEvent evt)
jsa1969 9:5150afa50eb6 287 {
jsa1969 19:52e19461e867 288 waitForLooppsToFinish();
jsa1969 12:96eb06e837f4 289 nvStore->resetNvStore();
jsa1969 19:52e19461e867 290 uBit.display.scroll("clear");
jsa1969 9:5150afa50eb6 291 }
jsa1969 9:5150afa50eb6 292
jsa1969 0:cef60cc92da0 293 int main()
jsa1969 0:cef60cc92da0 294 {
jsa1969 0:cef60cc92da0 295 uBit.init();
jsa1969 0:cef60cc92da0 296
jsa1969 0:cef60cc92da0 297 uBit.messageBus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onButtonA);
jsa1969 0:cef60cc92da0 298 uBit.messageBus.listen(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonB);
jsa1969 9:5150afa50eb6 299 uBit.messageBus.listen(MICROBIT_ID_BUTTON_AB, MICROBIT_BUTTON_EVT_CLICK, onButtonAB);
jsa1969 2:544117df8c65 300
jsa1969 9:5150afa50eb6 301 callbacks = new I2cCallbacks(&uBit);
jsa1969 12:96eb06e837f4 302 nvStore = new NvStore(&uBit);
jsa1969 9:5150afa50eb6 303
jsa1969 9:5150afa50eb6 304 initSensors();
jsa1969 9:5150afa50eb6 305
jsa1969 12:96eb06e837f4 306 startLoops();
jsa1969 2:544117df8c65 307
jsa1969 0:cef60cc92da0 308 release_fiber();
jsa1969 0:cef60cc92da0 309 }
jsa1969 0:cef60cc92da0 310