top of page

Arduino Frequency Generator5Khz , Adjustable Duty Cycle

Writer's picture: RAJ SHARMARAJ SHARMA

Arduino Code



#include <TimerOne.h>

//UNO only

void setup()

{

pinMode(9,OUTPUT);

Timer1.initialize(200); //200us = 5khz

Timer1.pwm(9,20); // 2% DC

// You can use 2 to 1023

// 0 & 1 gives a constant LOW

// 1024 gives a constant HIGH

// 2 gives ~125ns HIGH pulses

// 1023 gives ~125ns low pulses

// 512 gives 50us

}


void loop()

{

}



13 views0 comments

Recent Posts

See All

Yorumlar


​© 2014 INDIA Rajkumar Sharma                                                                                                                                                                                   Contact Me raj079@yahoo.com                                             

bottom of page