kodi.sudar
Member level 5
- Joined
- Dec 21, 2009
- Messages
- 92
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- india
- Activity points
- 1,849
The condition works well when i set the condition using adc value
but it fails to work when i assign using angle which is calculated using formula.
Is there any thing wrong with the above condition ?
It works great in keil when i executed and checked by step one line ,But it fails to work in proteus simulation .
Code:
Code:
if ((adc_val>=0x0000022B) && (adc_val<0x0000024D))
{
PWMMR2 = 0x0000004C;
PWMMR4 = 0x0000004A;
PWMLER = 0x0000014;
but it fails to work when i assign using angle which is calculated using formula.
Code:
Code:
if ((angle >= 7.996409) && (angle < 18.20971))
{
PWMMR2 = 0x0000004C;
PWMMR4 = 0x0000004A;
PWMLER = 0x0000014;
}
It works great in keil when i executed and checked by step one line ,But it fails to work in proteus simulation .