Skip to content

Commit f08c9a0

Browse files
authored
Solution for arduino pro micro
1 parent fbf0377 commit f08c9a0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

examples/softwareserial_debug/softwareserial_debug/softwareserial_debug.ino

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,26 @@ void setup() {
3131

3232

3333
canHacker = new CanHacker(interfaceStream, debugStream, SPI_CS_PIN);
34-
canHacker->enableLoopback();
34+
canHacker->enableLoopback(); // remove to disable loopback test mode
3535
lineReader = new CanHackerLineReader(canHacker);
3636

3737
pinMode(INT_PIN, INPUT);
3838
}
3939

4040
void loop() {
41+
CanHacker::ERROR error;
42+
4143
if (digitalRead(INT_PIN) == LOW) {
42-
CanHacker::ERROR error = canHacker->processInterrupt();
44+
error = canHacker->processInterrupt();
4345
handleError(error);
4446
}
47+
48+
// uncomment that lines for Leonardo, Pro Micro or Esplora
49+
// error = lineReader->process();
50+
// handleError(error);
4551
}
4652

53+
// serialEvent handler not supported by Leonardo, Pro Micro and Esplora
4754
void serialEvent() {
4855
CanHacker::ERROR error = lineReader->process();
4956
handleError(error);

0 commit comments

Comments
 (0)