initial commit
This commit is contained in:
24
PWMFrequency.h
Normal file
24
PWMFrequency.h
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
//
|
||||
// -----------------------
|
||||
// PWM FREQUENCY PRESCALER
|
||||
// -----------------------
|
||||
// Written by Kiwisincebirth 2014
|
||||
// Revised by MacTester57 (aka TheDIYGuy999) to allow correct PWM frequencies (confirmed with oscilloscope). January 2015
|
||||
// - prescale variable: replaced uint8_t with uint16_t data type (fixes bug, which did not allow frequencies < 492Hz)
|
||||
// - mode variable: replaced hex format with binary to make it more readable, if compared with bit tables in the 32U4 manual
|
||||
// - added comments
|
||||
//
|
||||
|
||||
#ifndef PWMFrequency
|
||||
#define PWMFrequency
|
||||
|
||||
#if ARDUINO >= 100
|
||||
#include <Arduino.h> // Arduino 1.0
|
||||
#else
|
||||
#include <WProgram.h> // Arduino 0022
|
||||
#endif
|
||||
|
||||
void setPWMPrescaler(uint8_t pin, uint16_t prescale);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user