Use this tag for questions about memory usage on the Arduino.

learn more… | top users | synonyms

1
vote
0answers
29 views

Writing objects to PROGMEM

A few days ago I encountered memory problems (SRAM shortage) on my Arduino. I've read a lot and fixed the problem, now i have around 900 bytes free in SRAM. However, i still have difficulties ...
1
vote
1answer
56 views

Help avoiding floating point math

I'm using a Texas Instruments DRV2605 haptic controller in my project to drive a LRA vibration motor. I would like to calculate the LRA rated voltage during run time using the formula below as ...
2
votes
1answer
40 views

Question of proper usage for F Macro

Here are three use cases. Are all preferred or is the use of the F() macro pointless on some? 1. Serial.println(F("some string"); // definitely useful here 2. String str = F("some string"); ...
2
votes
2answers
52 views

Help with a Memory Issue

Below is some code that I'm writing to concurrently run "animations" on the same strip of NeoPixels. When I try to make use of the Serial monitor to control the program functions, I just get a bunch ...
0
votes
3answers
30 views

Array deletion problem

I am a bit confused about how memory works in Arduino. I have created an integer array like so: int* arr = new int[3] {1, 2, 3}; When I go to delete it: delete[] arr; The first element is ...
1
vote
3answers
151 views

Storing an array of function pointers

I have some Arduino code that looks like: char packet = ser.read(); switch(packet){ case 'a': someobj.somefunc(); break; case 'b': otherobj.otherfunc(); ...
4
votes
1answer
109 views

Single #include pulls in all libraries

I am tracking down the memory usage of an Arduino-like project I am working on (not a real Arduino, but has same microcontroller and it uses the Arduino build environment, version 1.6.8). I have some ...
0
votes
2answers
49 views

Is there any way I can connect the RAM of a computer to Arduino?

I was thinking about a way to reuse the RAM of my old computer on my Arduino board. I was thinking about some peojects using neural networks, and more RAM would let the Arduino use more neurons. So ...
0
votes
1answer
63 views

Is the a low memory alternative to SoftwareSerial?

I'm running a program on a ATtiny85 and running into problems because of a lack of available RAM. When I ran avr-nm on my ELF file I found that SoftwareSerial was taking up a lot of RAM even though I'...
0
votes
2answers
94 views

Would rewriting my code in C help reduce RAM usage? [duplicate]

So my program fails to run because there is not enough room for my variables as well as the Arduino Core and Stack. I can't find any more ways to optimize my program so I'm thinking about just ...
3
votes
1answer
921 views

What is using up all the RAM in my program?

I am running a program on the ATtiny and for some reason I am way over the 512 bytes of RAM that are available to me. This is confusing because when I did the math by hand I should have 432 bytes. ...
2
votes
2answers
456 views

Can you access the EEPROM of an ATtiny with Arduino Code?

I'm attempting to reduce the amount of RAM being used by my program by writing some values to the EEPROM of my micro controller. I'm currently programming on the ATtiny85 which has 512 Bytes of EEPROM....
0
votes
2answers
39 views

I need more memory!

I am trying to make a RBB Arduino based project and I only need 3 pins. In the future I may use one to two more. I wanted to use an ATtiny85 however my code is 13,270 bytes and it would not fit. So I ...
0
votes
0answers
204 views

How can you write to the EEPROM on an ATtiny85 with Arduino Code?

I have an ATtiny85 and I wanted to use the EEPROM to store the values of the pins I am using in the code. Here is what I tried doing to store the value in the EEPROM: #include <EEPROM.h> void ...
1
vote
1answer
76 views

EEPROM - Storing Static Data

I'm trying to store four items to EEPROM. I can do one item no problem, I just don't know how to make the jump to multiple items. My code: #include <EEPROM.h> char sgrpID[31] = "acpilot's ...
0
votes
1answer
62 views

send serial monitor to server and save data in hdd [closed]

I'd like stream data to my disk via serial and then send it to a central server. e.g. log an event. i wouldn't use any separate modules. Any helps appreciated.
3
votes
2answers
436 views

What is the best way to get more RAM for a sound buffer?

The problem: How to extend the memory for a sound buffer (intensively used) if: SD card library supports only one file open at a time (and I have one open already) EEPROM chips are able to stand ...
0
votes
1answer
32 views

'Non-Deterministic' memory usage on Arduino

I had a problem with a memory leak in my sketch and cornered it with MemoryFree.h. This works great and I was able to fix my leak. My sketch is not really static, but My var sizes are. I observed, ...
1
vote
2answers
82 views

Forensic security of Arduino (SRAM)

Pardon the double post, but I'm not getting much traction with this question over at arduino.cc so I'm looking for answers here now. Original post: http://forum.arduino.cc/index.php?topic=391698.0 ...
2
votes
3answers
56 views

Is this function subject to memory fragmentation?

I'm trying to understand if the following bit of code is subject to memory fragmentation. Let's say I incrementally build a string within a function and I don't know how large the string should be. ...
0
votes
1answer
73 views

Shared Memory using SHM Library

I am trying to read sensor data from a FIFO buffer embedded in the sensor (LSM9DS1), and store that data on a Teensy 3.2 board to later be put in a file. I can only read 6 bytes at a time from the ...
1
vote
1answer
84 views

Connecting Winbond W49F002U-12B to Arduino Mega

I am trying to connect a CMOS flash memory Winbond W49F002U-12B to an Arduino Mega, but failing. What I did: Read the Winbond W49F002U-12B datasheet. The key points are: CE - chip enabled; OE - ...
4
votes
2answers
74 views

At what level does low dynamic memory effect performance?

I have a few Arduino sketches that take 70-90% of dynamic memory. It seems that over 70%, the compiler gives the warning: Low memory available, stability problems may occur. but otherwise I wasn't ...
0
votes
0answers
47 views

Memory reduction in converting Serial.read to int/byte from 0-255

I'm taking rgb values in over Serial in a format like c-255 255 255. I currently have this code, struct RGB { int r; int g; int b; }; struct RGB getRGBValues(char* rgbcode) { char *rgbend; ...
6
votes
1answer
167 views

Understanding global variables on Arduino

I am rewriting a set of LED manipulation functions to be more object oriented, and I have found that, mysteriously, my global variable memory space has been over consumed, despite a reduction of the ...
4
votes
2answers
52 views

Use large variables without using much memory

I've wired up a dot matrix, and I display characters on the screen by using something like the example code below. The Char_B variable is a global variable in a library used by the Arduino, and ...
0
votes
0answers
45 views

Is there a lean or modular SD library?

I'm using the SD library to perform two simple tasks. reading a configuration file writing a logfile I don't want to use subdirectories and can live with only two filenames. However, after ...
0
votes
1answer
615 views

Store String using F() Macro

I'm new to the Arduino and do not quite understand the F() macro yet. In my code, I have a String, and as I want to transfer it via WebServer, I need to write it to the answer. Somehow I need to ...
3
votes
1answer
82 views

What is the memory expense of creating a String from a char array?

I'm writing a little API for processing email messages in Arduinos. Obviously, I need to keep memory use down, but I also want to allow the end user to use the String functions (like indexOf) to ...
2
votes
2answers
82 views

Arduino Uno - why doesn't memory leak crash the program?

I wrote this test program: void loop() { digitalWrite(13,1); delay(300); digitalWrite(13,0); delay(300); void *a = malloc(10000000000000000000000000000000000000000); } Curiously,...
0
votes
2answers
171 views

Clearing SRAM in loop()

Very broad question here. I don't know exactly what the problem is but I'll edit this post as we narrow down the possibilities. I think I'm running into memory constraints. I'm running a sketch ...
0
votes
2answers
64 views

How to prevent inclusion of unnecessary libraries?

How do you save space by preventing the inclusion of unnecessary binaries? When I compiled the ROS Blink example, I received the warning: Global variables use 1,951 bytes (76%) of dynamic memory, ...
3
votes
2answers
230 views

How to correctly pack an unsigned long from 3 unsigned chars?

I would like to use 652 unsigned long values on an Arduino Uno, but it doesn't look like there's enough memory. I thought about the splitting unsigned long values to 3 unsigned chars to store in ...
6
votes
2answers
791 views

OOP vs Inline with Arduino

I have been programming for quite a while now but I am new to Arduino and AVR Programming. The main question I have about programming these Micro-controllers is are there major differences in ...
0
votes
0answers
21 views

Erratic storage space? (adding code results in less storage !?)

When I call a function that itself calls another one inside a small library, Arduino 1.6.4 (and .5) report a smaller program storage space than when I call the "inner" function only : The code inside ...
0
votes
1answer
52 views

Serial problem after implementing data structures

Context I first ran a sketch (on Arduino Uno) without any custom data structure and list, so I was using a bunch of arrays, methods and other primitive variables. And it worked perfectly. My program ...
2
votes
1answer
83 views

What will use less memory, an array or if … else?

I'm trying to make my sketch smaller. Right now I use an array for the AM/PM part of my time display. My thinking is this makes it easy to change the formatting: char* ampms[]= {"am", "pm"}; void ...
4
votes
1answer
372 views

Why does this code execute?

After experiencing failures of my Arduino projects due to low memory, I decided to do some research into it so I could understand better where the problems were. I eventually came to this code: void ...
2
votes
1answer
295 views

any way to run binary code from RAM?

I am looking for an unexpensive single board computer that I could program in assembly language, using limited facilities to load the object code from a PC and simple I/O peripherals. Ideally I would ...
0
votes
1answer
135 views

Serial3.available loop issue

I am trying to read information coming from an Atlas Scientific FLO30 chip. The following code works fine in an individual sketch: String inputstring = ""; ...
1
vote
3answers
1k views

How to write data in RAM memory using Arduino Uno or Arduino Due?

I know that it is possible to write data in ROM(Read Only Memory). But what about if I want to write data in RAM(Random Access Memory)? Can I do it using "Arduino Uno R3"? RAM is normally associated ...
0
votes
1answer
68 views

How do I know how many memory that Arduino is use after my code is running for a few time [duplicate]

When I upload my program to Arduino it says the memory that the program is used. But what if I use a bad management of dynamic memory, or any object is created several times in use a lot of memory and ...
1
vote
1answer
168 views

Measure SRAM usage

I am using an Arduino with 2048 bytes of SRAM. I have a complex project so that it is no longer obvious how much SRAM it would use in total (there is not one large dominant object but many different ...
5
votes
1answer
142 views

Overview of compiled code size

When I compile my code, the Arduino IDE returns the binary sketch size in byte. Is there a good way to find out (approximately) what function or what part of my code takes up how much memory in ...
0
votes
2answers
153 views

How to increase Arduino's memory to save Dot Matrix Library?

I need to display some dynamic Chinese characters to 12864 using Arduino. What to show is transported from my web server. The character is stored as a 16x16 dot matrix, needing 16*16/8=32 byte. And I ...
0
votes
1answer
298 views

Memory Problems on Arduino Uno

I am doing a project using Arduino UNO, cc3000 WIFI chip, micro SD card shield, and a TTL serial camera in order to make a security system that will post a picture online (not enough processing power ...
1
vote
1answer
304 views

Am I Running Out of RAM Or Not?

I'm attempting to drive 300 TM1803 RGB LEDs from an Arduino Uno using the FastLED library. My code works fine for 100 LEDs, but when I go to 150, the arrays that store LED values and my sensor data ...
0
votes
1answer
282 views

How can I analyse large packets on an Arduino?

I'm trying to send a large packet to an Arduino with an ethernet shield on it? I'm using the built in RX buffer of W5100 controller to store the data, but I need more memory (at least 16K of buffer ...
2
votes
2answers
207 views

Is there any way that the values here be converted to another variable and not string?

int val1 =(mfrc522.uid.uidByte[0]); int val2 =(mfrc522.uid.uidByte[1]); int val3 =(mfrc522.uid.uidByte[2]); int val4 =(mfrc522.uid.uidByte[3]); String valA=String(val1); String valB=String(val2); ...
1
vote
1answer
296 views

Are my arrays stored in sram or in Flash?

I have the following memory allocation: unsigned char g1[]={ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ....0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; g2[]={ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 .......