Pages: 1 2 [3]   Go Down
Author Topic: Serial print refresh time  (Read 2118 times)
0 Members and 1 Guest are viewing this topic.
California
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AWOL was right, my example was "rubbish".

They should have been char or byte rather than short. The concept still stands, just didn't have the right type for my example.
« Last Edit: May 25, 2012, 04:33:36 pm by Arrch » Logged

New Hampshire
Offline Offline
God Member
*****
Karma: 13
Posts: 779
There are 10 kinds of people, those who know binary, and those who don't.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Program size that is shown by Arduino is the size of the 'code' portion of the hex file.  Variable declaration data is stored in the same file, but as a separate 'section' of the file, and is not included in the reported program size.  The details of the hex file are a bit more complicated, but if you're feeling particularly ambitious, this page: http://www.nongnu.org/avr-libc/user-manual/mem_sections.html will give you an introduction to how it's laid out.  Just be forewarned, it may only make you more confused than you currently are though.  It isn't beginner material.
Logged


UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh - that would explain perfectly why the size isn't changing! I think I'll leave studying the link too hard for a while! smiley-grin

If an int (or a long or anything for that matter) is not defined as either signed, or unsigned - which does it default to? Unsigned I'd presume.
Logged

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

you'd presume wrong.

Some are signed, some are unsigned.

The basic types (int, char, short, etc) are usually signed by default.

Special types defined specifically by the Arduino code (byte, etc) may be unsigned.  You'd have to read the documentation to be sure.

That's why I never use the arduino specific ones and always use proper named ones.

Of course, there are the explicit ones - uint16, etc, where the "u" means unsigned, and the 16 means 16-bit, or 2 bytes.
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

UK
Offline Offline
God Member
*****
Karma: 1
Posts: 530
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, I've got what I need to know for this program at least. I can't see saving 1 or 2 bytes here or there are going to help with anything in the long run anyhow - but knowledge is king  smiley-evil

Thanks to all those who replied for their help!
Logged

Pages: 1 2 [3]   Go Up
Jump to: