Extibal

Control DR44G Alternator with Arduino

May 19th, 2016
1,740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <PWM.h>
  2. int32_t frequency = 128; //frequency (in Hz)
  3.  
  4. void setup() {
  5. // put your setup code here, to run once:
  6. InitTimersSafe();
  7. bool success = SetPinFrequencySafe(9, frequency);
  8. if(success) {
  9. pinMode(13, OUTPUT);
  10. digitalWrite(13, HIGH);
  11. }
  12. }
  13.  
  14. void loop()
  15. {
  16. // put your main code here, to run repeatedly:
  17. pwmWrite(9, 191);
  18. delay(30);
  19. }
Add Comment
Please, Sign In to add comment