Skip to content

Commit 8c90338

Browse files
Merge pull request #156 from Korniluk13/setPeriodBug
Bug in setPeriod command
2 parents 7de47d6 + eedc7af commit 8c90338

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

trikControl/src/powerMotor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ void PowerMotor::powerOff()
8585
void PowerMotor::setPeriod(int period)
8686
{
8787
mCurrentPeriod = period;
88-
QByteArray command(3, '\0');
88+
QByteArray command(4, '\0');
8989
command[0] = static_cast<char>((mMspCommandNumber - 4) & 0xFF);
90-
command[1] = static_cast<char>(period && 0xFF);
91-
command[2] = static_cast<char>(period >> 8);
90+
command[2] = static_cast<char>(period & 0xFF);
91+
command[3] = static_cast<char>(period >> 8);
9292
mCommunicator.send(command);
9393
}
9494

0 commit comments

Comments
 (0)