Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: ButtonCallbackTank: Correct the max value to 200 #2

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

dirkbehme
Copy link

The CircuitCube::BuildVelocityCommand() adds 55 to the value sent to the CircuitCube. As the max value is 255, passing 255 to it results in an overflow, resulting in no Cube (Tank) movement. Limit the value to 200 so that in the end 255, the max value, is sent. In main loop() see the for() loop in TRAIN_CONTROL mode which limits the max value to 200, too.

This is for non TRAIN_CONTROL mode (i.e. TRAIN_CONTROL define disabled).

The CircuitCube::BuildVelocityCommand() adds 55 to the value sent
to the CircuitCube. As the max value is 255, passing 255 to it results
in an overflow, resulting in no Cube (Tank) movement. Limit the value
to 200 so that in the end 255, the max value, is sent. In main loop() see the
for() loop in TRAIN_CONTROL mode which limits the max value to 200, too.

This is for non TRAIN_CONTROL mode (i.e. TRAIN_CONTROL define disabled).

Signed-off-by: Dirk Behme <[email protected]>
@asperka asperka merged commit c9b4850 into asperka:main Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants