Skip to content

Commit

Permalink
ping360: set baudrate before turning motor off
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxxzer committed Jan 11, 2024
1 parent 7f44b7f commit 3ef3ac7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sensor/ping360.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,12 @@ Ping360::~Ping360()
ping360_motor_off message;
message.updateChecksum();

// set the baudrate for two reasons:
// 1: if doing an auto scan, this will break the sensor out of
// automatic transmission mode
// 2: use a low baudrate to decrease chances of corruption in transmission
setBaudRate(9600);

// Stop scanning and turn off the stepper motor
for (int i {0}; i < 10; i++) {
writeMessage(message);
Expand Down

0 comments on commit 3ef3ac7

Please sign in to comment.