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.
Check out more hacks here…
Join 7,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord
CircuitPython in 2018 – Python on Microcontrollers is here!
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!
Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/
Maker Business — The many, many manufacturing processes listed on Wikipedia
Wearables — A bevel illusion
Electronics — Don’t float!
Biohacking — Optimizing the Warm Up
Python for Microcontrollers — CircuitPython 3.0.0 released!
Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com
Sorry, the comment form is closed at this time.