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
The library has no provision for a bad communication or even the IC not present, the sketch will simply hang and will not work.
It must has a way to alert the user that the IC in not there or even that there is no IC. In it most basic form it must not hang the full sketch for this.
The text was updated successfully, but these errors were encountered:
While playing with the console example, I added these lines near the end of setup()
Serial.println <the banner>
if ( Si.i2cRead(0) > 0 ) devicePresent = 1; // should return the RevID=B, -1 is missing.dead si,
//Serial.print("Si.i2cRead(0) = "); Serial.println(Si.i2cRead(0),BIN);
//Serial.print("devicePresent = ");Serial.println(devicePresent);
if ( devicePresent == 1) { cmdHelp(); }
else { // err msg & loop forever
Serial.println(F("DEVICE MISSING. STOPPING."));
while(1);
}
While this just warns the user and hangs, it is just the console and if the chip is not there then there is no point in continuing.
Most projects will have a display, so the user can be warned. Behavior (hang or not) should be the programmer's choice. For those without a display, a buzzer error code pattern or an LED blink pattern could be used to alert the user,
Agree, I'm thinking on a function that allows the user to test the presence of the IC.
Like Si.ok(), true if present & working, and false otherwise. In this way the user can implement his own checks & warn via LED/Dispaly/Serial/whatsoever...
The library has no provision for a bad communication or even the IC not present, the sketch will simply hang and will not work.
It must has a way to alert the user that the IC in not there or even that there is no IC. In it most basic form it must not hang the full sketch for this.
The text was updated successfully, but these errors were encountered: