Skip to content

Commit

Permalink
Solution for arduino pro micro
Browse files Browse the repository at this point in the history
  • Loading branch information
autowp authored Nov 10, 2016
1 parent fbf0377 commit f08c9a0
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,26 @@ void setup() {


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

pinMode(INT_PIN, INPUT);
}

void loop() {
CanHacker::ERROR error;

if (digitalRead(INT_PIN) == LOW) {
CanHacker::ERROR error = canHacker->processInterrupt();
error = canHacker->processInterrupt();
handleError(error);
}

// uncomment that lines for Leonardo, Pro Micro or Esplora
// error = lineReader->process();
// handleError(error);
}

// serialEvent handler not supported by Leonardo, Pro Micro and Esplora
void serialEvent() {
CanHacker::ERROR error = lineReader->process();
handleError(error);
Expand Down

0 comments on commit f08c9a0

Please sign in to comment.