@@ -34,6 +34,7 @@ ScienceKitCarrier::ScienceKitCarrier(){
34
34
inputA=0 ;
35
35
inputB=0 ;
36
36
timer_inputA = 0 ;
37
+ board_resolution = BOARD_RESOLUTION;
37
38
38
39
apds9960 = new APDS9960 (Wire,INT_APDS9960);
39
40
proximity=0 ;
@@ -235,6 +236,9 @@ void ScienceKitCarrier::update(const bool roundrobin){
235
236
236
237
237
238
239
+
240
+
241
+
238
242
/* *******************************************************************/
239
243
/* Analog Inputs */
240
244
/* *******************************************************************/
@@ -249,7 +253,7 @@ void ScienceKitCarrier::updateAnalogInput(const uint8_t input_to_update){
249
253
if ((input_to_update==UPDATE_INPUT_A)||(input_to_update==UPDATE_ALL)){
250
254
251
255
if (!getExternalTemperatureIsConnected ()){
252
- inputA=analogRead (inputA_pin);
256
+ inputA=analogRead (inputA_pin)>>board_resolution ;
253
257
#ifdef ESP32
254
258
beginExternalTemperature ();
255
259
#endif
@@ -260,7 +264,7 @@ void ScienceKitCarrier::updateAnalogInput(const uint8_t input_to_update){
260
264
261
265
}
262
266
if ((input_to_update==UPDATE_INPUT_B)||(input_to_update==UPDATE_ALL)){
263
- inputB=analogRead (inputB_pin);
267
+ inputB=analogRead (inputB_pin)>>board_resolution ;
264
268
}
265
269
}
266
270
@@ -279,12 +283,14 @@ int ScienceKitCarrier::getInputB(){
279
283
/* *******************************************************************/
280
284
/* APDS9960 */
281
285
/* *******************************************************************/
286
+
282
287
int ScienceKitCarrier::beginAPDS (){
283
288
if (!apds9960->begin ()) {
284
289
return ERR_BEGIN_APDS;
285
290
}
286
291
return 0 ;
287
292
}
293
+
288
294
void ScienceKitCarrier::updateAPDS (){
289
295
wire_lock;
290
296
if (apds9960->proximityAvailable ()){
@@ -407,8 +413,6 @@ float ScienceKitCarrier::getResistanceMeasureVolts(){
407
413
return value;
408
414
}
409
415
410
-
411
-
412
416
float ScienceKitCarrier::getResistance (){
413
417
return resistance;
414
418
}
@@ -590,6 +594,7 @@ float ScienceKitCarrier::getMagneticFieldZ(){
590
594
591
595
592
596
597
+
593
598
/* *******************************************************************/
594
599
/* LEDs: errors and status */
595
600
/* *******************************************************************/
@@ -680,6 +685,9 @@ void ScienceKitCarrier::freeRTOSStatusLed(void * pvParameters){
680
685
#endif
681
686
682
687
688
+
689
+
690
+
683
691
/* *******************************************************************/
684
692
/* Function Generator Controller */
685
693
/* *******************************************************************/
@@ -722,6 +730,8 @@ uint8_t ScienceKitCarrier::getRange2(){
722
730
723
731
724
732
733
+
734
+
725
735
/* *******************************************************************/
726
736
/* Ultrasonic Sensor */
727
737
/* *******************************************************************/
@@ -802,10 +812,13 @@ void ScienceKitCarrier::freeRTOSUltrasonic(void * pvParameters){
802
812
}
803
813
#endif
804
814
815
+
816
+
817
+
818
+
805
819
/* *******************************************************************/
806
820
/* External Temperature Probe */
807
821
/* *******************************************************************/
808
- // WIP
809
822
810
823
int ScienceKitCarrier::beginExternalTemperature (){
811
824
new (&ow) OneWireNg_CurrentPlatform (OW_PIN, false );
@@ -854,7 +867,6 @@ void ScienceKitCarrier::updateExternalTemperature(){
854
867
}
855
868
}
856
869
857
-
858
870
float ScienceKitCarrier::getExternalTemperature (){
859
871
return external_temperature;
860
872
}
@@ -880,9 +892,13 @@ void ScienceKitCarrier::freeRTOSExternalTemperature(void * pvParameters){
880
892
#endif
881
893
882
894
895
+
896
+
897
+
883
898
/* *******************************************************************/
884
899
/* Microphone */
885
900
/* *******************************************************************/
901
+
886
902
#ifdef ARDUINO_NANO_RP2040_CONNECT
887
903
int ScienceKitCarrier::beginMicrophone (){
888
904
PDM.setGain (50 );
@@ -920,6 +936,7 @@ uint ScienceKitCarrier::getMicrophoneRMS(){
920
936
921
937
922
938
939
+
923
940
/* *******************************************************************/
924
941
/* Threads */
925
942
/* *******************************************************************/
@@ -976,6 +993,9 @@ void ScienceKitCarrier::startAuxiliaryThreads(const uint8_t auxiliary_threads){
976
993
}
977
994
978
995
996
+
997
+
998
+
979
999
/* **
980
1000
* _ _
981
1001
* /\ | | (_)
0 commit comments