int pwmpin_1 = 9;
int pwmpin_2= 10;
int pot = A0;
void setup()
{
// change pwm frequency of pwm pin 9 and 10 .....from 490 Hz to 32kHz
TCCR1B = TCCR1B & B11111000 | B00000001;
pinMode(pwmpin_1,OUTPUT);
pinMode(pwmpin_2,OUTPUT);
pinMode(pot, INPUT);
}
void loop()
{
int potVal = map(analogRead(pot), 0, 1023, 0, 255);
analogWrite(pwmpin_1,potVal);
analogWrite(pwmpin_2,potVal);
}
that is my last code which generates 30Khz well and i am controlling the duty cycle with POT
i need to add Phase shift between the 2 Pulses but i can't figure out how