File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 23
23
#define WIRE Wire1
24
24
#endif
25
25
26
+ // Set to true to print some debug messages, or false to disable them.
27
+ #define ENABLE_DEBUG_OUTPUT true
28
+
26
29
Adafruit_PWMServoDriver::Adafruit_PWMServoDriver (uint8_t addr) {
27
30
_i2caddr = addr;
28
31
}
@@ -45,9 +48,13 @@ void Adafruit_PWMServoDriver::setPWMFreq(float freq) {
45
48
prescaleval /= 4096 ;
46
49
prescaleval /= freq;
47
50
prescaleval -= 1 ;
48
- Serial.print (" Estimated pre-scale: " ); Serial.println (prescaleval);
51
+ if (ENABLE_DEBUG_OUTPUT) {
52
+ Serial.print (" Estimated pre-scale: " ); Serial.println (prescaleval);
53
+ }
49
54
uint8_t prescale = floor (prescaleval + 0.5 );
50
- Serial.print (" Final pre-scale: " ); Serial.println (prescale);
55
+ if (ENABLE_DEBUG_OUTPUT) {
56
+ Serial.print (" Final pre-scale: " ); Serial.println (prescale);
57
+ }
51
58
52
59
uint8_t oldmode = read8 (PCA9685_MODE1);
53
60
uint8_t newmode = (oldmode&0x7F ) | 0x10 ; // sleep
You can’t perform that action at this time.
0 commit comments