Skip to content

Commit

Permalink
Realize the function of sending stop command by pressing the stop but…
Browse files Browse the repository at this point in the history
…ton.
  • Loading branch information
ZhuYanzhen1 committed Sep 11, 2021
1 parent 1778d18 commit b92bb37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ MainWindow::~MainWindow(){
}

void MainWindow::mdtp_callback_handler(unsigned char pid, const unsigned char *data){
// qDebug() << "pack:" << pid << " data:" << data[0] << data[1] << data[2] << data[3]
// << data[4] << data[5] << data[6] << data[7];
if(pid == 0){
uint32_t velocity = (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
uint32_t angle = (data[4] << 24) | (data[5] << 16) | (data[6] << 8) | data[7];
Expand Down Expand Up @@ -67,6 +65,8 @@ void MainWindow::on_start_stop_btn_clicked(){
buffer[0] = 0x1E;
mdtp_data_transmit(0x01, buffer);
}else{
buffer[0] = 0x2D;
mdtp_data_transmit(0x01, buffer);
ui->start_stop_btn->setText("Start");
}
}
Expand Down

0 comments on commit b92bb37

Please sign in to comment.