Hello Guys
i've connected an potentiometer to AN0 of PIC16F877 & read the results on 8 LEDS connected to portD & its ok
but i need to display the exact value of ADC on 2 7segment displays for Calculating Values for a Thermistor
was thinking how to get (for example) "15" on 7seg
i can send 1 to tens in my 7seg display Routine & 5 to units
But when i get 0F as value from ADC how to Seperate it to use 1 for tens & 5 for units?
i need this to make a table for a Thermistor reading
This is the routine im using to display Values on 7 segments
Where is your circuit diagram? How are you connecting 7seg with controller?
I d'not know assembly but i can explain you in simple math and c language. If you want to send 15 to 7seg. you would be break ADC_Value(15) to two part.
Where is your circuit diagram? How are you connecting 7seg with controller?
I d'not know assembly but i can explain you in simple math and c language. If you want to send 15 to 7seg. you would be break ADC_Value(15) to two part.
Your controller pin AN0 is ADC pin where you are reading analog potentiometer value.
for exa.
value is 15. i am ADC Value/10 dividing 15 by 10. result will be 1 because it is a integer type. ADC Value %10 I am getting reminder of 15 with divide by 10. it will be 5.
& my circuit conected with the 7 segment the same way your code in C works
You can not send data directly to port for display wit 7seg. you would need a 7seg driver ic like 4511 or you would be need make function as your circuit.
for example.
i want to send 1 value. if i will send 1 to PORTD. it will like 00000001. if my 7seg is connected directly to my port... at this time only single LED will lightup but i need 2 LED lightup for sow 1 on 7Seg.
So wht i need is tht Really seperate a number into 2 parts But in assembly