Source code for Zero crossing detector in C

Status
Not open for further replies.

amsbhole07

Member level 1
Joined
Oct 28, 2010
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,535
Hi,

I am trying to built the light dimmer using Microcontroller and i am using MOC3011 and Triac BT136 and Zero crossing detector using Transistor BC847

Can any one give me the source code for Zero crossing detector in C
 

Re: Light Dimmer Project

im giving a sample code here
here is some tutorial on PWM
use this code to dimming the light as u can

void delay_ms(unsigned int i)
{
unsigned int j;
while(i-->0)
{
for(j=0;j<500;j++)
{
;
}
}
}
void delay_micro(unsigned int i)
{
unsigned int s;
for(s=0;s<i;s++)
{
;
}
}


void main()
{
unsigned int i;
while(1)
{

for(i=0;i<200;i++)
{
led=0;
delay_micro(i);
led=1;
delay_ms(20);
}

}
}
 

Re: Light Dimmer Project

but without using PWM how we can write the COde
 

Re: Light Dimmer Project

in the above code i didn't use PWM,it is only with delays
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…