OK!!!!!!
FBV is declared as a BYTE so IF FBV < 256 THEN will always evalute true. FBV can never be larger then 255 so FBS will always be incremented to 8 and then stay there.
/Henrik.
OK!!!!!!
FBV is declared as a BYTE so IF FBV < 256 THEN will always evalute true. FBV can never be larger then 255 so FBS will always be incremented to 8 and then stay there.
/Henrik.
hmm.... you are right.
but from this blog (http://forum.allaboutcircuits.com/blog.php?b=512) i found that i convert to picbasic. but not working!!!!
can you solve this problem????
Hi,
THERE'S NO NEED TO SHOUT, WE HEAR YOU LOUD AND CLEAR!
Think about that last statement for a while.
When exactly do you expect FBV be equal to itself + 30? That's simply never going to evalute true because it will always compare itself to a larger value.
In PBP bytes and words are unsigned, they can never be less then zero. So something like IF A > 0 THEN will always evalute true.
When you do ADCIN 0, Volt the variable Volt will always be positive so FBV=FBV+Volt will keep accumulating FBV over and over and over again untill it overflows and starts over.
Finally, in the code in your first post you have DEFINE OSE 16, that's not correct and you don't seem to do any sort of setup for the ADC, manually or with DEFINEs - check the manual.
/Henrik.
Last edited by Antorbd04; - 31st March 2014 at 11:59.
I see that you have started a new thread. Looking for more code giveaways? Once again your statement:
"I hope your advise is correct but unfortunately I unable to understand what you say & what you order me to change in my code. If you give me the correct code then I will very happy." sounds like you know nothing about the project you are trying to re-create. It also sounds like you want everybody to drop everything they are doing to write your code for you when you say:
"I am very sorry for that. But I need this project as soon as possible" Maybe you should have been studying the language and the project before the last minute.
Just my 2 cents.....
Dave Purola,
N8NTA
EN82fn
Bookmarks