ADD: example code for turbo boost

This commit is contained in:
Niklas Fauth
2018-05-08 13:06:10 +02:00
parent 312d08b944
commit 206f67631a
3 changed files with 16 additions and 7 deletions

View File

@@ -141,6 +141,11 @@ int main(void) {
timeout = 0;
#endif
// ####### ADDITIONAL CODE #######
#ifdef ADDITIONAL_CODE
ADDITIONAL_CODE;
#endif
// ####### LOW-PASS FILTER #######
steer = steer * (1.0 - FILTER) + cmd1 * FILTER;
speed = speed * (1.0 - FILTER) + cmd2 * FILTER;
@@ -155,11 +160,6 @@ int main(void) {
setScopeChannel(2, (int)speedR);
setScopeChannel(3, (int)speedL);
// ####### ADDITIONAL CODE #######
#ifdef ADDITIONAL_CODE
ADDITIONAL_CODE;
#endif
// ####### SET OUTPUTS #######
if ((speedL < lastSpeedL + 50 && speedL > lastSpeedL - 50) && (speedR < lastSpeedR + 50 && speedR > lastSpeedR - 50) && timeout < TIMEOUT) {
pwmr = speedR;