I'm a beginner at Arduino and I have been trying to make my own MIDI controller using the Control surface library by Pieter P. I would like to include a number of buttons and a Nokia 5110 Graphic LCD to display drawings each time a button is pressed.
I came across a blog which explains how to upload drawings by specifying the position of every pixel that is to be filled (or not) into the screen. And it looked like endless lines of hexadecimal ennumeration:
So I thought, what if I make this array an object and store it within a user library to save up space? Does it make sense, and if it does, how can I do it?
Or are there any other tricks to reduce space while using multiple libraries?
Nope… the array, wether in your main code or a library will end up occupying the same amount of flash…
When you use multiple libraries, only the needed functions are part of your final code. If you are short of space and your code is not badly written qnd you picked trusted libraries , then it might be time to get a more capable arduino.
However, in the development of Control Surface, ease of use usually comes before memory footprint, so for more complex controllers with displays etc., it is worth upgrading to a more powerful 32-bit microcontroller with more memory. It also means that you could write special-purpose code with similar features and significantly lower memory consumption.
Ok, I will check out those tricks and finish up the code to see if I need to upgrade to another microcontroller. I'm using an Pro micro because I need to have a small circuit so I implemented some multiplexers. And I wanted to ask you;
I have 2 (74HC4051) multiplexers with the same address pins and diferent input pins but I don't know where to specify the second input.
CD74HC4051 mux {
A0, <------- I tried here but it didn't compile
{3, 4, 5}
};
Also, I am so glad you could answer, thank you so much for creating Control surface. I am new to the open source community and to see so much work shared encourages me to keep learning >.<
Flash (and EEPROM) are different, you can generally assume that if you can get the IDE to successfully upload to the microcontroller, then everything is good. (It is not like you get money back for not using all the Flash.)