alpha91
Full Member level 3
Hi all, i am learning PWM with PIC16f628a now with C language using MikroC compiler.
I encounter ' main function is not defined main function is not defined' error. May i know what is the error means?
below is my code:
is my code correct? i am trying to light up an LED with PWM. I want to light up the LED with slowly increase its brightness and then decrease slowly and off. For example: The LED slowly increase its brightness till max within 5 seconds and slowly decrease within 5 seconds as well.
I encounter ' main function is not defined main function is not defined' error. May i know what is the error means?
below is my code:
void main()
{
TRISB = 0b00000000;
PWM1_Init(5000); // Initialize PWM1
PWM1_Set_Duty(127);
PWM1_Start(); // start PWM1
while (1)
}
is my code correct? i am trying to light up an LED with PWM. I want to light up the LED with slowly increase its brightness and then decrease slowly and off. For example: The LED slowly increase its brightness till max within 5 seconds and slowly decrease within 5 seconds as well.
Last edited: