You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Firmware/OpenLog_Artemis/autoDetect.ino
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -268,6 +268,8 @@ bool beginQwiicDevices()
268
268
269
269
qwiicPowerOnDelayMillis = settings.qwiicBusPowerUpDelayMs; // Set qwiicPowerOnDelayMillis to the _minimum_ defined by settings.qwiicBusPowerUpDelayMs. It will be increased if required.
270
270
271
+
int numberOfSCD30s = 0; // Keep track of how many SCD30s we begin so we can delay before starting the second and subsequent ones
272
+
271
273
//Step through the list
272
274
node *temp = head;
273
275
@@ -395,6 +397,13 @@ bool beginQwiicDevices()
395
397
SCD30 *tempDevice = (SCD30 *)temp->classPtr;
396
398
struct_SCD30 *nodeSetting = (struct_SCD30 *)temp->configPtr; //Create a local pointer that points to same spot as node does
397
399
if (nodeSetting->powerOnDelayMillis > qwiicPowerOnDelayMillis) qwiicPowerOnDelayMillis = nodeSetting->powerOnDelayMillis; // Increase qwiicPowerOnDelayMillis if required
400
+
numberOfSCD30s++; // Keep track of how many SCD30s we begin
401
+
// Delay before starting the second and subsequent SCD30s to try and stagger the measurements and the peak current draw
402
+
if (numberOfSCD30s >= 2)
403
+
{
404
+
printDebug("beginQwiicDevices: found more than one SCD30. Delaying for 375ms to stagger the peak current draw...\r\n");
405
+
delay(375);
406
+
}
398
407
temp->online = tempDevice->begin(qwiic); //Wire port
0 commit comments