Hi Jocelyn,
I don't believe you will be able to apply that foumula. Its not to do with Flowcode.
It's the way PIC maths work.
For example bytes are just whole numbers (no rounding up).
So 894/5=178
The problem will arise if result is less then 0 and not using float numbers or multiplying out first
E.g 1/1024*5000
= 1/1024 = 0
0*5000=0
Result = 0
If using a calculator results will be totally different
= 4.88 (2dp)
Your Flowchart using ADC ReadAsString will produce correct results on your LCD anyway,
So no need to apply that formula, since it's automatically done for you.
Jocelyn wrote:
As sensor hardware is connected to RB4/AN10 pin of pic16f690 should then light the LEDs sequentially in an binary fashion representing the ADC result value.
Then, either using the ADC conversion formula to convert the binary value to decimal value or any other possible method to display decimal value on LCD.
The problem is If your using an input and an output on the same pin (i/p and RS of LCD), if not using a resistor in series with the i/p-o/p pin then if pot is used and middle connection is near the Ground to give 0V, then microcontroller will be supply too much current when pin is an o/p, hence will be damaged.
Also if your connecting LEDS to the LCD data line, then while LCD is being updated the LED will be going on and off with the LCD data.
Changing i/p to a diffident pin maybe the way to go.
Looking at your flowchart, your using An0 (pin 19 ) and not An10.
If you want to change to a different analog i/p then:
Right click on the pot on your Control panel and select connections.
From the drop down box select correct channel:
As for interfacing with thermistors:
The maximum i/p voltage to a microcontroller is the same as the supply voltage = 5V
Normally there is a resistor connected to 5V, a thermistor connected between other end resistor and 0V (GND of microcontroller)
The junction of resistor/thermistor connected to i/p of microcontroller.
Or the other way round i.e thermistor connected to +5V and resistor connected to the other end of thermistor and 0V
Take a look at page 102 of your attachment.
When you have decided what connections to use with your microcontroller, I can help you out with your code.
Martin