Thanks a lot Gramo, but still need your help if possible.
need to modify your program to do the following.
I have a number n1n2n3.n4 saved on the internal ROM of the PIC
I need to read it and add it to a number which must be between 0and 1
let me call it x . this number will be entered to the pic. in my first trial i can assume that it s a fix number let s take it 0.2
and then the final summation n1n2n3.n4 + x will be saved on the ROm on the same location of the previous n1n2n3.n4 and displayed on the LCD
my main problem is how to store the n1n2n3.n4 , i must store each digit alone? n1 on one address n2 on another and so on ....?
Here's a common list of variable types for most micro controller compilers (this list is from Swordfish); **broken link removed**
If you declare a number as a float, it can be used as a normal number with 3 decimal place accuracy. Keep in mind that floats take a lot of code overhead to really make them a viable option in most applications.
What is the maximum and minimum possible values that will be stored in the float? Perhaps I can show you much faster way to go about things.
Well if you scale it (x100) the maximum value will only be 19999, so it will fit in a word variable, be a LOT faster, and be 100% accurate (floats aren't always accurate).
well i need to perform an addition between a number of the form xxx.xx (saved on the internal eprom )and a number which will be entered to the pic (between 0 and 1 )
the result of the operation will be displayed on the LCD + saved on the eprom of the form xxx.xx
i must write it using picbasic pro cz i have other part to add to it and assembly will take me lot of time to do...
Have you seen the more than comprehensive help file with the compiler? I really suggest that you start with the basics of integer math, see how things "click" and then use the same analogy to use scale integer math as a replacement too using floats