Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <PWM.h>
- int32_t frequency = 128; //frequency (in Hz)
- void setup() {
- // put your setup code here, to run once:
- InitTimersSafe();
- bool success = SetPinFrequencySafe(9, frequency);
- if(success) {
- pinMode(13, OUTPUT);
- digitalWrite(13, HIGH);
- }
- }
- void loop()
- {
- // put your main code here, to run repeatedly:
- pwmWrite(9, 191);
- delay(30);
- }
Add Comment
Please, Sign In to add comment