Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top