Page 1 of 1

PRINT ADC VALUE DISPLAY PD4437

Posted: Mon Feb 01, 2010 4:56 am
by armagon29
Dear All:

I have a question, I made a program where I have to print the ADC value in 1 Intelligent display OSRAM PD4437, but I don’t know how?, this display needs a ASCII value for each digit¡

1.- how to split the ADC value in a individually value, this mean as example ADC value is 450, I have to split :, first digit 4, second 5 and finally 0
2.-then, how can I to covert each individual digit in ASCII character, 4 = 52, 5 = 53 and 0 = 48


THANKS

Re: PRINT ADC VALUE DISPLAY PD4437

Posted: Mon Feb 01, 2010 9:57 am
by medelec35
Give this a try.
The ASCII is printed as a integer, not a string. If you wanted a string can be easily converted.
Im sure someone will come up with a simpler way, but at least you you have a working version.

Re: PRINT ADC VALUE DISPLAY PD4437

Posted: Mon Feb 01, 2010 5:01 pm
by armagon29
Dear Sir:

Your example is very interesting for me, thanks, but I have one question additional, you used to print into LCD the variable ASCII, but is possible to load each digit in a individually variable (255)?, It is necessary because I have to print each digit individually

Thanks

Re: PRINT ADC VALUE DISPLAY PD4437

Posted: Mon Feb 01, 2010 5:15 pm
by medelec35
armagon29 wrote:Dear Sir:

but is possible to load each digit in a individually variable (255)?, It is necessary because I have to print each digit individually.
Thanks

It's already done individually. If you step through the program by pressing F8, you will see each ASCII is printed one at a time as the program loops. I.e Str_Var[0]=1st set of ASCII, Str_Var[1]=2nd set of ASCII etc
However, I understand what yo are saying and will post a version using var(255)

Re: PRINT ADC VALUE DISPLAY PD4437

Posted: Mon Feb 01, 2010 10:25 pm
by medelec35
This version, you alter the pot, then the pot setting will converted into each individual ASCII (from 0 to 1023)and sent to LCD. E.g if pot is on max then ASCII of 1 is sent to display, then ASCII of 0 is sent to display, then ASCII of 2 is sent to display and finally ASCII of 3 is sent to display
If pot is set to min then only then ASCII of 0 will be sent to display. I have set this on a loop, so it will be constantly reading pot and sending ASCII equivalent to Display
Note: I have adjusted Flowcode to individually produce ASCII numbers as in your first post. The LCD does have have a 'Print ASCII' macro for you to use as well. I have left that macro at the very bottom of flowcode, so it is not used. Just replace the print number with print ASCII function. Not sure which one will work as I have not got same LCD as you to test.
At least you have a choice
This should be enough for you to change the way you want it to suit your application.

Hope this helps.