Go Down

Topic: reinventing the wheel again (Read 3582 times) previous topic - next topic

John_Smith

Thinking about the memory savings, I have simply included the path and sketch name in the serial print, and then have the comments at the top again commented out.
Thanks guys.
45 years of editing projects with a knife and soldering iron, then I found Arduino !

GoForSmoke

By memory savings you mean flash, right?  Because

Serial.println( F( "this string stays in flash, not ram" )); // will show in a hex dump as well as print

1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

John_Smith

Now you are confusing me again :-)  I mean one line of text as a serialPtrint in setup, must be more economical chipwise than the 10 lines I was trying ?
45 years of editing projects with a knife and soldering iron, then I found Arduino !

GoForSmoke

Yes.  :smiley-evil:

The data can be kept totally in flash and print from there using the F( ) macro.
Flash is where your program lives, it's what you download sketches into.
Flash also holds constant data like strings (messages, prompts) and lookup tables.

An UNO chip ( ATmega328P ) has 32K of flash and 2K of RAM. Saving RAM is paramount while saving flash only matters when you really push program and data limits, not a usual practice.

If your 10 lines have useful data then stick them in there. Version, Usage, Errors, use them all.

You have the syntax down?

 
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up