Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sketch-size]

The tag has no usage guidance.

0
votes
1answer
41 views

What is the easiest way to count how many global variables are in your sketch code?

I have a fairly complicated sketch with about 1k lines of code. I should also say that I'm not a programmer by trade... As I go over my code and try to make it more efficient, it'd be good to know ...
1
vote
1answer
199 views

PROGMEM doesn't cause Sketch size to change

I'm trying to pinpoint some strange behaviour involving the use of PROGMEM and the size of a Sketch. I've written a library that contains a number of functions, in addition to several large global ...
1
vote
4answers
2k views

How to reduce sketch size? [closed]

How to reduce sketch size? I got an error that “Sketch uses 30,044 bytes (104%) of program storage space. Maximum is 28,672 bytes.” I can't reduce function in sketch.I can't change ATmega32u4,now. ...
1
vote
4answers
112 views

Porting code from Arduino IDE to other IDEs - expected code size reduction

Could I realistically be expecting some 25% - 50% code size reduction if I abandoned Arduino IDE's framework and moved to something more rudimentary such as AVR Studio ? I am using the EEPROM, Timer1 ...
4
votes
3answers
972 views

Sizeof variables and Due's RAM

I set out to see how much space some arrays have. I used this test code bool state = false; uint16_t BuffA[46000]; uint16_t BuffB[20000]; uint16_t BuffC[20000]; uint16_t all = 0; void setup(){ ...
-1
votes
1answer
40 views

smaller program bigger sketch

I'm working on a program composed by several classes. I reduced the size of a single class of (more or less) one hundred lines (4kb of stuff) I expected a smaller sketch but surprisingly it is ...
0
votes
0answers
55 views

Large stack-based buffer in class without filling up program storage space

I am observing large changes to the program storage space used by my code when I change the size of buffers in my objects. An example object: class MyClass { uint8_t buffer[1024]; // ... }; ...
3
votes
2answers
822 views

What programming practices should be adopted while coding sketches for Arduino?

What are some of the best programming practices that can be adopted while coding sketches for Arduino, so that it uses the least memory and performance should not suffer from memory outage, and still ...
1
vote
1answer
44 views

How can I tell how large my program is?

Scenario When I upload my project via the Arduino ide I see this at the bottom: Writing | ################################################## | 100% 4.14s avrdude: 25698 bytes of flash written ...
1
vote
3answers
1k views

Why does HC-SR04 return 0s in this sketch

I am building a robot with multiple sensors, abilities etc. Since I had a bug with a HC-SR04 rotated by a servo, I experimented in a different sketch. If the distance is less than 30cm, the servo ...
5
votes
3answers
1k views

How can I reduce the size of my sketch?

Looks like I'm overshooting the storage of my Adafruit Trinket: Sketch uses 5,600 bytes (105%) of program storage space. Maximum is 5,310 bytes. Global variables use 109 bytes of dynamic memory. Any ...
1
vote
4answers
312 views

I am planning to do a periodic table with Arduino's help but I have a few questions

I'm doing that for my school project, but I have few questions before I purchase the components. First of all, let me explain how it will work: There will be 4x20 LCD, an Arduino and probably two ...
4
votes
1answer
249 views

How to add the Wiring S board to Arduino IDE v.1.6.2?

My Arduino Uno is running out of memory to support my script (yes, I've tried several ways of optimize it already: PROGMEM, EEPROM, no Strings, and so on), so I would like to upload my script to my ...
0
votes
3answers
2k views

Feasability of flashing Arduino UNO r3 with teensy firmware for HID (keyboard) emulation purposes

I've been working on a DIY keyboard project I have all the hardware designed and now its time for the code. For the microcontroller, I'm sort of locked into an Arduino UNO r3 as I already have it ...
5
votes
5answers
705 views

Should I try to make my sketches as small as possible, even when I have enough room?

There has been a lot of talk about shrinking sketches recently, but if you don't need the room, should it be done? Will it speed up my program? Take this code: int led = 13; int val; void setup() { ...
26
votes
4answers
70k views

What can I do if I run out of Flash memory or SRAM?

According to the Arduino documentation, the ATmega328 has 32KB of Flash memory for the bootloader + uploaded sketch, and only 2KB SRAM for runtime data. The ATmega2560 has quite a bit more, totalling ...
11
votes
1answer
156 views

Is there a preprocessor constant for memory size

I would like my compiles to exclude some code depending upon the flash/program space available. To be used in the demo code of a library I support. Whereas my current solution is to use a #ifdef of ...