Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How can a STRING be converted to it's individual BYTES

Status
Not open for further replies.
Example please? Vlad offers several ways of doing this...
The string is only a byte array... so you can do this

mystring = "Hello"
a = mystring(1)
b = mystring(2)

a will equal 'e' and b will equal 'l'
 
Example please? Vlad offers several ways of doing this...
The string is only a byte array... so you can do this

mystring = "Hello"
a = mystring(1)
b = mystring(2)

a will equal 'e' and b will equal 'l'
Hi I,
When I asked the question I was sending a STRING STRQEIDEG, which is a WORD via SPI, where we were having trouble, decoding at the other end.
After a lot of tries we tried splitting the STRING into it's 2x BYTEs using 'QEIDEG =StrValW(strqeideg)' (following your example of reading the D/S :) ) and SENT 2x separate BYTES. (W = WORD VALUE)
This works.
Thanks, C.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top