Skip to content
Browse files

speedup

  • Loading branch information...
1 parent 45b7d67 commit ff90285212e957951f029c02062b7a2ea1118679 @ladyada ladyada committed Dec 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 examples/pwmtest/pwmtest.pde
View
6 examples/pwmtest/pwmtest.pde
@@ -31,13 +31,15 @@ void setup() {
// if you want to really speed stuff up, you can go into 'fast 400khz I2C' mode
// some i2c devices dont like this so much so if you're sharing the bus, watch
// out for this!
+
+ pwm.begin();
+ pwm.setPWMFreq(1600); // This is the maximum PWM frequency
// save I2C bitrate
uint8_t twbrbackup = TWBR;
+ // must be changed after calling Wire.begin() (inside pwm.begin())
TWBR = 12; // upgrade to 400KHz!
- pwm.begin();
- pwm.setPWMFreq(1600); // This is the maximum PWM frequency
}
void loop() {

0 comments on commit ff90285

Please sign in to comment.
Something went wrong with that request. Please try again.