@@ -24,15 +24,12 @@ unsigned long lastNotify = 0;
2424
2525ScienceKitCarrier science_kit;
2626
27- // rtos::Thread _thread_check_connection(osPriorityHigh);
2827rtos::Thread _thread_update_sensors;
2928
3029bool _is_connected = false ;
3130
3231
3332void setup () {
34- // pinMode(8,OUTPUT);
35- // pinMode(7,OUTPUT);
3633
3734 science_kit.begin (NO_AUXILIARY_THREADS); // Doesn't start the BME688 and external temperature threads for the moment
3835
@@ -82,23 +79,10 @@ void setup() {
8279 _thread_update_sensors.start (update); // this thread updates sensors
8380}
8481
85- /*
86- void loop_data() {
87- bool last_connected_status = _is_connected;
88- while (1) {
89- delay(1000);
90- if (last_connected_status != _is_connected) {
91- digitalWrite(7, _is_connected ? HIGH : LOW);
92- }
93- }
94- }
95- */
9682
9783void update (void ){
9884 while (1 ){
99- // digitalWrite(8,HIGH);
10085 science_kit.update (ROUND_ROBIN_ENABLED);
101- // digitalWrite(8,LOW);
10286 rtos::ThisThread::sleep_for (20 );
10387 }
10488}
@@ -183,6 +167,7 @@ void updateSubscribedCharacteristics() {
183167 humidityCharacteristic.writeValue (science_kit.getHumidity ());
184168 }
185169
170+ // need to be fix
186171 if (sndIntensityCharacteristic.subscribed ()) {
187172 if (science_kit.getUltrasonicIsConnected ()){
188173 sndIntensityCharacteristic.writeValue (science_kit.getDistance ()*100.0 );
@@ -192,6 +177,7 @@ void updateSubscribedCharacteristics() {
192177 }
193178 }
194179
180+ // need to be fix
195181 if (sndPitchCharacteristic.subscribed ()) {
196182 sndPitchCharacteristic.writeValue (science_kit.getExternalTemperature ());
197183 }
0 commit comments