Hi...
I am generating two pwm signal for two different switches.The arrangement of switch is like half bridge inverter. I want to give delay between these two signal.
#include"Arduino.h"
#include "TimerOne.h"
double duty, ref;
void setup()
{
Timer1.initialize(100); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)
}
void loop(){
// Main code loop
ref=9;
if (ref > 10) {
duty=(ref-10.5)*1023;
duty=duty/10.5;
Timer1.pwm(10,duty);
//delayMicroseconds(40);
Timer1.pwm(9,duty);
}
}
When i am giving delay in this code , it is not working.
so how to do please tell me.
I don't want to do it in hardware.