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
PRINT ADC VALUE DISPLAY PD4437
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PRINT ADC VALUE DISPLAY PD4437
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.
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 498 times
Martin
Re: PRINT ADC VALUE DISPLAY PD4437
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
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
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PRINT ADC VALUE DISPLAY PD4437
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 etcarmagon29 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
However, I understand what yo are saying and will post a version using var(255)
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PRINT ADC VALUE DISPLAY PD4437
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.
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 514 times
Martin