Hi Guys
I am saving a string in I2C memory eg Hello World now when I read it back I get the decimal number for it 72(H) 101(e) 108(l) 108(l) 111(0) 32(space) 87(W) 111(o) 114(r) 108(l) 100(d) how do I convert that back into a string of characters? If anyone knows of an exsample it would be much appreciated.
I have tried looking at the example Ben did (NumberConversion) but I can't figure out what it does as I can't step through it
Convertin from decimal to Characters
Moderator: Benj
-
- Valued Contributor
- Posts: 1191
- Joined: Wed May 31, 2017 11:57 am
- Has thanked: 70 times
- Been thanked: 440 times
- Contact:
Re: Convertin from decimal to Characters
When you print out the read back characters you are 'printing' or displaying them as numbers (they are the ASCII representation of the desired string). Post your code and we'll be able to change if needed...
Martin
Martin
- jollybv
- Flowcode v5 User
- Posts: 374
- Joined: Thu Feb 12, 2009 5:20 am
- Location: Cape Town
- Has thanked: 81 times
- Been thanked: 25 times
- Contact:
Re: Convertin from decimal to Characters
Hi
Thanks for the reply what in trying to do is read back the memory and then change it to Characters so I can use it in an SMS message string. If I read back each byte then convert to string it will send a string of numbers, not letters. I have made an example of what I'm trying to do
Thanks for the reply what in trying to do is read back the memory and then change it to Characters so I can use it in an SMS message string. If I read back each byte then convert to string it will send a string of numbers, not letters. I have made an example of what I'm trying to do
- jollybv
- Flowcode v5 User
- Posts: 374
- Joined: Thu Feb 12, 2009 5:20 am
- Location: Cape Town
- Has thanked: 81 times
- Been thanked: 25 times
- Contact:
Re: Convertin from decimal to Characters
Hi
Thanks for that works perfectly, took a whole day of trying and still could not see how simple it was thanks again.
Thanks for that works perfectly, took a whole day of trying and still could not see how simple it was thanks again.