Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 27b0519

Browse files
committed
Attach bumper interrupt to stop condition.
1 parent 1ad9f7f commit 27b0519

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

robot-control-src/robot-control-src.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ void setup()
8181
Serial.printf("\n begin program '%s'\n", __FILE__);
8282
Wire.begin(board::sda, board::scl);
8383
board::ioExpander1.init();
84+
board::ioExpander1.interruptMode(MCP23017InterruptMode::Separated);
85+
board::ioExpander1.interrupt(MCP23017Port::B, FALLING);
8486

8587
// initialize pins
8688
pinMode(board::debugLed, OUTPUT);
@@ -92,6 +94,8 @@ void setup()
9294

9395
drives::LeftDrive::init();
9496
drives::RightDrive::init();
97+
98+
attachInterrupt(board::ioExpanderIntB, drives::stopDrives, FALLING);
9599

96100
Serial.printf("connect to wifi %s ", ssid);
97101
WiFi.begin(ssid, password);

0 commit comments

Comments
 (0)