Serial.print

Can anyone explain why Serial.print(“,MakeSoundAndMotion”);

on the UNO gives me this on the monitor: MakeSoundAndMotion126110136127154

The baud rates are matched and most of the other data is clean.

Looks almost like the old DOS stuff when a string was missing a terminator.

I thought it might be too much RAM usage, but I’m only counting 319 bytes.

Thank you,

Joe

Make it println instead of print. Do the numbers shift down a line? If so, you have an extra print statement in there. If not, show all your code.

Does the comma really not show up in the print?

Sorry about that – the comma does show. I just missed it because I’m using it in a csv file and didn’t see it. How about the stack? Do you know how much room is allocated for that normally? I used to mess with the stack in assembly, but like this higher stuff a lot better! I’m going to line up calls and see if they might be too deep. println and print produce the same results.

Thank you for your suggestions.

Stack should be fine for such a simple case.

Assuming it’s not an issue with nested function calls in your program.

We see here only one line of code.

On AVRs, there’s a way to force C strings to be in flash and not copied to RAM, to save some RAM.

Thank you for the information. I have found that I have four nested calls in one situation. That strikes me as a little deep for the poor little UNO, so I am doing a bit of a rewrite to cut it back. Again, thank you.

Turns out it’s the programmer’s error. That would be me! Again, thank you,.

time to graduate to Teensy 3.1!! Arduino-compatible 32bit ARM M4

http://www.pjrc.com/teensy/index.html

Looks good. I have a ministry with kids, part of which is teaching electronics and programming to control hardware. Think the Teensy 3.1 could aid in that? Currently I base part of it on my Listening Tree

http://www.jameco.com/webapp/wcs/stores … 2173714_-1

and Listening Car

http://www.jameco.com/webapp/wcs/stores … 2199551_-1

I tell kids that I would like to see them design an autonomous bicycle someday – not easy, but I think doable.

Thank you for your help and advise. I have been programming in C for almost 30 years but still make dumb mistakes at times, and being 70 doesn’t help!

Joe