Skip to content

Commit 57d2202

Browse files
clawpiladyada
andcommitted
Interrupt example: continuous prox output with IRQ notices
Co-authored-by: ladyada <limor@ladyada.net>
1 parent 3eb7aa3 commit 57d2202

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/interrupt_threshold/interrupt_threshold.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,19 @@ void setup() {
7474
}
7575

7676
void loop() {
77+
Serial.print(F("Prox: "));
78+
Serial.print(vcnl.readProximity());
79+
7780
if (intFired) {
7881
intFired = false;
79-
uint16_t prox = vcnl.readProximity();
8082
uint8_t flags = vcnl.readInterruptFlags();
8183

82-
Serial.print(F("INT! Prox: "));
83-
Serial.print(prox);
84-
8584
if (flags & VCNL4030_PROX_IF_CLOSE)
86-
Serial.print(F(" -> CLOSE"));
85+
Serial.print(F(" *** IRQ CLOSE ***"));
8786
if (flags & VCNL4030_PROX_IF_AWAY)
88-
Serial.print(F(" -> AWAY"));
89-
90-
Serial.println();
87+
Serial.print(F(" *** IRQ AWAY ***"));
9188
}
89+
90+
Serial.println();
91+
delay(100);
9292
}

0 commit comments

Comments
 (0)