Good day to all,
Please i need your support.I am Controlling Led brightness with PWM Signal and at the same time Displaying the duty cycle(represented in %) on an Lcd Display.The Problem i am having is that the percentage of the duty cycle shown on the oscilloscope is different from the value shown on my Lcd Display.For example when the oscilloscope showed 50% duty cycle the value shown on the LCD was 38%.I would be glad if somebody could help me have a look at my code may be there is something i am not doing correctly.Below are my lines of code.Thank you for the usual Support.
Best regards.
[code lang="c"]
# define F_CPU 1000000UL
#include
#include
#include
#include "NewHeaven_LCD.h"
int main( void )
{
int LED_Power=1;
int On_Time=0;
// Set PWM-Port PB4
PORTB = 0x00;
DDRB |=(1
Please i need your support.I am Controlling Led brightness with PWM Signal and at the same time Displaying the duty cycle(represented in %) on an Lcd Display.The Problem i am having is that the percentage of the duty cycle shown on the oscilloscope is different from the value shown on my Lcd Display.For example when the oscilloscope showed 50% duty cycle the value shown on the LCD was 38%.I would be glad if somebody could help me have a look at my code may be there is something i am not doing correctly.Below are my lines of code.Thank you for the usual Support.
Best regards.
[code lang="c"]
# define F_CPU 1000000UL
#include
#include
#include
#include "NewHeaven_LCD.h"
int main( void )
{
int LED_Power=1;
int On_Time=0;
// Set PWM-Port PB4
PORTB = 0x00;
DDRB |=(1