Questions tagged [array]
Refers to code that present variables in the form of an array.
280 questions
3
votes
1
answer
294
views
Arduino Nano IoT 33 Char Array size constraints
I would like to save data that I am receiving from API calls in a char array. The problem is that the data is around 80 kB, and my Arduino IoT 33 only has 32 kB of memory.
It will save data in a char ...
0
votes
1
answer
88
views
How to modify the Leonardo's HID descriptor
I'm trying to make an Arduino Leonardo work with a PS4 following a similar approach as ArduinoXInput with its modified AVR core. However, even though I managed to add the device and configuration ...
0
votes
1
answer
130
views
Serialise a struct containing a flexible array
I want to serialise and deserialise a struct containing a flexible array.
I did find a working code but wondering if it is the most elegant and optimum way to do it.
This is my first attempt below ...
0
votes
2
answers
106
views
Passing an array as an argument to a function [closed]
Please help how make it work.
int myArray1[] = {10, 11, 12};
int myArray2[] = {15, 16, 17};
void setup() {
Serial.begin(9600);
}
void loop() {
myFunction(myArray1); delay(1000); // i want to use ...
1
vote
1
answer
277
views
Why does filling up a large char array cause a crash? (ESP8266)
Here's the code in question:
void setup() {
Serial.begin(115200);
Serial.println();
char test[5000];
int i;
for (i = 0; i < sizeof(test)-1; i++) {
test[i] = 'x';
Serial....
2
votes
2
answers
439
views
Arduino receive response from SIM800H to AT+CCLK? command
I've been trying to make a program that interacts with SIM800H trough AT commands. It worked with the String class, but it was full of "memory leaks" and after a few hours it just hanged. ...
1
vote
2
answers
136
views
Is there a maximum length of an array in ROM?
Consider the following code:
#include <Arduino.h>
unsigned char testimage [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
...
-1
votes
1
answer
326
views
Large arrays crash the arduino
I have three large PROGMEM arrays, in order to store musical notes for a song. One array is the notes, one is the note durations, and one is the pause after the note.
The first array is an int one and ...
1
vote
1
answer
411
views
stream a "big" array of measures to a server through wifi
I'm measuring accelerations at "high frequency" (4kHz) from an accelerometer (ADXL355/ADXL357) to an esp32. It's crucial that no sample is lost while performing a measure which last say 2 ...
0
votes
1
answer
2k
views
How to send int array with ESP8266 http post request?
I'm reading RFID cards' UID with an ESP8266 and trying to send that information to my web server hosted on a Raspberry Pi. I'm currently storing the UID in an int array, but the http.POST(); function ...
1
vote
1
answer
793
views
ArduinoJSON - How to check if array is empty
Parameters file defines the creation of entities and stored in flash. Its structure is given, and all fields ( keys & values ) are given.
In current phase - those parameters are hard-coded in a ...
1
vote
2
answers
118
views
Program to Multiply Numbers Won't Actually Multiply Them
I am trying to write a program which takes in a number of pairs to be multiplied, then prints out the result of each multiplication. Instead of doing this, the program just prints out the number of ...
0
votes
3
answers
14k
views
Does int array[100] = {0} construct work on Arduino?
I'm compiling my code in Arduino IDE. I have an array that I want to 0-initialize. I know memset works on Arduino, but I'm used to this way from my desktop C++ programming practice:
int array[100] = {...
-1
votes
3
answers
146
views
What is the best way to create a library from existing functions?
I was tasked to take functions that work, and create a library with these functions.
Take a look at the following function that existed inside a program:
char* Num_to_HEX_char_array(int32_t value)
{
...
1
vote
0
answers
129
views
Converting more strings from serial monitor to int arrays
I want to transfer 8 lists from a python script, via Serial Monitor to the Arduino. I can get the strings to Arduino and Arduino saves them as String array, but I can't change it to integer (it shows ...