Recieving a string via serial and display it via graphics.spin
propwell
Posts: 87
Hi together,
i've got some serious problems with programming my propeller:
I've got an ATMega-Microcontoller communicating with my prop, and i want to send a message via printf("Hello World"); from the ATMega to the propeller.
The Propeller should read the message, save it in an array or string, and finally display it via the graphics.spin!
Unfortunately, i don't have any clue how to deal with strings etc.!
Is there a function how to convert a byte-variable into a string?
Please, could anyone help me?
Thank you,
propwell
Post Edited (propwell) : 12/5/2009 1:47:25 PM GMT
i've got some serious problems with programming my propeller:
I've got an ATMega-Microcontoller communicating with my prop, and i want to send a message via printf("Hello World"); from the ATMega to the propeller.
The Propeller should read the message, save it in an array or string, and finally display it via the graphics.spin!
Unfortunately, i don't have any clue how to deal with strings etc.!
Is there a function how to convert a byte-variable into a string?
Please, could anyone help me?
Thank you,
propwell
Post Edited (propwell) : 12/5/2009 1:47:25 PM GMT
Comments
i don't have to use an array, an byte-Variable works.
that example works just fine. But now, i want to replace the static text with a text, transmitted via SerialMirror.spin and the printf/putchar-functions of the ATMega-Controller.
The Code in the ATMega:
in the propeller, it should work anyhow like this:
Unfortunately, there are just some stupid signs appearing on the screen, which have nothing to do with the text i transmitted.
I think it has something to do with the conversion to a string!
Can anyone help me? the string() function doesn't work with a variable as an argument.
Thank you very much,
propwell
bit more suited toward what you want to do.
obex.parallax.com/objects/31/
Your current code is receiving "bytes" not strings and is likely part of the
problem you are running into. Also that graphics driver isn't exactly
suited for much more than simple text display. If you want the text
to scroll, etc you want to move to a "text" driver.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Isn't there a way to convert bytes to a string? I'll have a try with the Extenden FDSD, but as i've seen, it is just able to handle 15 characters, 20-30 would be my dream.
like this? i can't get anything to display with that!
Note that it's possible (easy) to modify the extended full duplex serial object to handle any given size string. Just change the internal buffer (datain) to a larger one and modify the limits (15 / 16) in the code to whatever you want. I'm surprised that the limit wasn't coded in as a named constant so it could be changed with a recompilation, but it's easy enough to change.