Skip to content

Commit

Permalink
Added definition of PWMRANGE, as it is no longer defined in Arduino.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinbert authored May 19, 2024
1 parent a77a49c commit a552a23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ros_diffdrive_robot.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@
#define LED_BUILTIN 2 // Remapping the built-in LED since the NodeMcu apparently uses a different one.
#define LED_BUILTIN_RED 16 // If using a NodeMcu v1, then there's another red onboard led.
// The min amount of PWM the motors need to move. Depends on the battery, motors and controller.
// The max amount is defined by PWMRANGE in Arduino.h
#define PWM_MIN 300
// Due to an update of the Arduino environment, PWMRANGE is no longer defined in Arduino.h, so we have to define it ourselves. Make sure the value corresponds to your microcontroller. Arduino default is 255, while NodeMCU uses 1023 (at the time of creating this project).
#ifndef PWMRANGE
#define PWMRANGE 1023
#endif



// Declare functions
void setupPins();
Expand Down

0 comments on commit a552a23

Please sign in to comment.