Why does this code not work as expected?
uint8_t hardlimit = 25
uint16_t current_limit = 6000;
if(current_limit < (hardlimit * 100))
{
//Turn off buzzer
}
else
{
//Turn on buzzer
}
If I change the variable hardlimit to an int it works fine, or just hard code the limit.
example
if(current_limit < 2500)
I am not getting it. This has something to do with data types. Can someone explain this to me? How do I solve this issue. Changing the variable hardlimit to a int is not an option.
Thanks