Skip to content

Commit

Permalink
Update bbn_m5atomS3_lite_AS3935_lightning.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Nov 13, 2024
1 parent a543d04 commit c79bc54
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ void setup() {

pinMode(lightningInt, INPUT); // When lightning is detected the interrupt pin goes HIGH.

Wire.begin(); // Begin Wire before lightning sensor.

if ( !lightning.begin(Wire) ) { // Initialize the sensor.
Serial.println("Lightning Detector did not start up, freezing!");
Wire.begin();
if ( !lightning.begin(Wire) ) {
Serial.println("Lightning Detector did not start!");
while (1);
}

Expand All @@ -49,13 +48,9 @@ void loop() {
uint8_t intVal = lightning.readInterruptReg();
if (intVal == NOISE_INT) {
// Noise
// Too much noise? Uncomment the code below, a higher number means better noise rejection.
//lightning.setNoiseLevel(setNoiseLevel);
}
else if (intVal == DISTURBER_INT) {
// Disturber
// Too many disturbers? Uncomment the code below, a higher number means better disturber rejection.
//lightning.watchdogThreshold(threshVal);
}
else if (intVal == LIGHTNING_INT) {
Serial.println("Lightning Strike Detected!");
Expand All @@ -65,7 +60,6 @@ void loop() {
Serial.print("Approximately: ");
Serial.print(distance);
Serial.println("km away!");

long lightning_energy = lightning.lightningEnergy();
Serial.print("Lightning Energy: ");
Serial.println(lightning_energy);
Expand Down

0 comments on commit c79bc54

Please sign in to comment.