If you're sure that ADRES content is OK, If ADRES >= 40 then ; do something elsif ADRES <= 60 then : do something else endif
Assuming the ADRES content is an 8 bit register containing your ADC result (you know what ADRES is) and 255 = 5V then 40 = 0.78V 60 = 1.17V Is this what do you expect in your real life? On Sun, Jun 23, 2013 at 1:16 AM, speedy23 <[email protected]> wrote: > I have tried adding brackets and it does not work. The closest I have got > is with > > if (ADRES >= 40 ) then if (ADRES <= 60 ) then... > > Many Thanks > > On Saturday, 22 June 2013 07:25:11 UTC+1, Kiste wrote: > >> >> Have you tried using brackets? like >> >> if (ADRES >= 40) and (ADRES <=60) then ... >> >> This way you can be sure the boolean values are ANDed. >> >> I've had a lot of trouble with comparisons from compiler bugs, might be a >> never compiler version helps. >> >> Greets, >> Kiste >> >> >> if ADRES >= 40 and ADRES <=60 then Interval = 5000 >> else Interval = 1200 >> >> Most things that seem logical fail. >> >> Any help/suggestions would greatly appreciated. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jallib" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to jallib+un...@**googlegroups.com. >> To post to this group, send email to [email protected]. >> >> Visit this group at >> http://groups.google.com/**group/jallib<http://groups.google.com/group/jallib> >> . >> For more options, visit >> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >> . >> >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/jallib. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/jallib. For more options, visit https://groups.google.com/groups/opt_out.
