PRINT ADC VALUE DISPLAY PD4437

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

PRINT ADC VALUE DISPLAY PD4437

Postby armagon29 » Mon Feb 01, 2010 4:56 am

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8236
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2358 times
Been thanked: 3347 times
Contact:

Re: PRINT ADC VALUE DISPLAY PD4437

Postby medelec35 » Mon Feb 01, 2010 9:57 am

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.
Attachments
Int to ASCII.fcf
(4.5 KiB) Downloaded 257 times
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

Re: PRINT ADC VALUE DISPLAY PD4437

Postby armagon29 » Mon Feb 01, 2010 5:01 pm

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8236
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2358 times
Been thanked: 3347 times
Contact:

Re: PRINT ADC VALUE DISPLAY PD4437

Postby medelec35 » Mon Feb 01, 2010 5:15 pm

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)
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8236
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2358 times
Been thanked: 3347 times
Contact:

Re: PRINT ADC VALUE DISPLAY PD4437

Postby medelec35 » Mon Feb 01, 2010 10:25 pm

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.
Attachments
Int to ASCII5.fcf
(7 KiB) Downloaded 261 times
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.