Dear Keil users, I'm new here. In BLINKY I want to do the following :
Write the A/D value read from the potentiometer and write it onto the LCD panel
Analogvalue 754
#include <stdio.h> // after reading the analog value set_cursor (0, 0); sprintf(text1,"Analogwert %5d",AD_value); lcd_print (text1);
But I don't know how to read the value from the potentiometer.Any suggestions? Thanks for advance for any help. Adel.
Look Adel, this is not the way to go. Seriously, you *MUST* know what you're doing before you start with thi stuff - the fact that your code "works" means nothing at all. it does not make any sense - at least not the ADC related parts. you are asking the ADC to interrupt the processor when the conversion is ready, yet you poll the value in the wait function :-0 ! so I guess you can shutdown the "conversion ended" interrupt all together, not? Please please please sit down, read and learn first... Good luck again
Is this whole forum full of people just taking the pi*s, getting people to spend good time replying to complete idiots?
Listen Dodgey Dave ***,
First of all you have to respect the terms of use in the forum and don't say to anyone an iodot. Second, this a public forum and all people could post their question regardless of their programming level. I don't see in this forum any rubric for low or advanced levels. And if you're not able to respond to questions let your comemnts in your home. So respect yourself next time.
So, have you performed the normal routine of eliminating possible error sources?
Have you verified that the potentiometer can generate the full range of voltages that the ADC can measure?
Have you verified that the ADC voltage reference is correct?
Have you verified that the binary value you read from the ADC can take any value between 0 and 0x3ff, i.e. between 0 and 1023?
Have you verified that your sprintf - if given a value of 1023 - will produce a correct text string?
Have you verified that said string will be corerctly sent to the display?
Performing these steps should give a good indication exactly what problem you have - and how/if you can fix it.