Here is a slightly advanced hack. If you have a project that needs lots of ram for buffering data or other nonsense, you can get 10% more by cutting down the ram used in the Serial library. Unless you’re doing a project with a lot of Serial data coming in, you wont need 128 characters…I find 16 or 32 is plenty!
Open up hardware/cores/arduino directory, and edit the file named wiring_serial.c
Near the top is a #define RX_BUFFER_SIZE 128, which means 128 bytes are used for the buffer. You can change this to 32 (or even 16!). If you have almost no serial input, make it as low as you’d like as long as its > 0.
You can get another 2 bytes by changing the head and tail index values from int to uint8_t type. Just recompile your sketch and it will automatically do your thing.
Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.
Join us every Wednesday night at 8pm ET for Ask an Engineer!
Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground” – Adafruit’s Apps!
Maker Business — Raspberry Pi and CoderDojo Join Forces
Wearables — Gold glow
Electronics — Linear Love
Biohacking — Nike’s Unlimited Stadium Will Put Your Best Foot Forward
Sorry, the comment form is closed at this time.