The process of improving the efficiency of a program such that is uses less memory and/or less computational time.
3
votes
4answers
680 views
What's the most efficient implementation of map(x,0,1023,50,250)?
I recently noticed how the map() function in Arduino was bulky in both terms of flash space used and time taken to execute, largely because it deals with long and involves a division and ...
3
votes
2answers
5k views
How can I declare an array of variable size (Globally)
I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled ...
1
vote
1answer
96 views
How to enable maximum Dead Code Removal?
I am running out of code and data memory space on ATMega328P.
Code size is big as I used several libraries, but, I only use a few functions of those library.
Apparently, the default IDE is only ...
1
vote
2answers
75 views
Questions on programming logic?
So I am learning arduino code by going through examples and playing with them, and I came across something interesting. I am not fluent in any coding language but I am fully familiarized with computer ...
0
votes
1answer
48 views
Sweep with two shift registers
I am working with 8 dual color LED's and 2 shift registers. My connections are in place. But I do not understand how to work with 2 shift registers.
So I am trying to make this: turn the first led ...
0
votes
2answers
41 views
Program button to switch between two values
There is a function on one of my programs I want to be switch on and off by pressing a button. The button is unbiased otherwise I would set the function to read the button's status of HIGH or LOW.
So ...
0
votes
1answer
57 views
Control arduino with keybaord via computer
I'm brand new to arduino but I'm trying to figure out how to set up a WASD steering system for my robot I made.
I have the physical setup all ready but I don't know the code to use that would allow ...
0
votes
2answers
93 views
What is the simplest way to “ask” the arduino which input pins are HIGH?
I am trying to build a 36-line cable tester, using the Digistump DigiX (99 i/o pins). Digital pins 0-35 are outputs, connected via the cable in question, to (in a perfect world) digital input pins ...
0
votes
2answers
56 views
releasing memory in sub-function
I'm doing a program who get a line from the SD and shows it, this function is called getData()
FULL CODE:
#include <SD.h>
#include <MemoryFree.h>
File myFile;
int stringIndex = 0;
int ...