Skip to content
This repository was archived by the owner on Sep 30, 2021. It is now read-only.

Fix reversed order of evaluation of args in call to LineFollow::config #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/ArduinoRobotMotorBoard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ void RobotMotorBoard::parseCommand(){
int value;
int speedL;
int speedR;
uint8_t KP;
uint8_t KD;
uint8_t robotSpeed;
uint8_t integrationTime;
if(this->messageIn.receiveData()){
//Serial.println("data received");
uint8_t command=messageIn.readByte();
Expand Down Expand Up @@ -119,12 +123,11 @@ void RobotMotorBoard::parseCommand(){
pauseMode(messageIn.readByte());//onOff state
break;
case COMMAND_LINE_FOLLOW_CONFIG:
LineFollow::config(
messageIn.readByte(), //KP
messageIn.readByte(), //KD
messageIn.readByte(), //robotSpeed
messageIn.readByte() //IntegrationTime
);
KP = messageIn.readByte();
KD = messageIn.readByte();
robotSpeed = messageIn.readByte();
integrationTime = messageIn.readByte();
LineFollow::config(KP, KD, robotSpeed, integrationTime);
break;
}
}
Expand Down