Questions tagged [array]
Refers to code that present variables in the form of an array.
279 questions
0
votes
1
answer
111
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
99
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
266
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....
1
vote
2
answers
135
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
320
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
406
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 ...
1
vote
1
answer
764
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
113
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 ...
-1
votes
3
answers
141
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
127
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 ...
0
votes
1
answer
104
views
Send a 2d PROGMEM array over SoftwareSerial
I have a 2d array:
const byte messages_for_measurement[2][8] PROGMEM =
{
{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 },
{ 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 },
};
I want to send ...
1
vote
1
answer
265
views
Conditional assignment of array
I have some really long global variable arrays filled with data.
There is a single function that processes the data. The function works on only one array everytime. This arrays value changes every ...
0
votes
1
answer
114
views
Problem with character concatenation algorithm in matrix led
good afternoon, I am making a 7x10 led matrix in which I use a CD4017 to handle the 7 rows and 2 cascaded shift registers to handle the 10 columns.
I first tried a programming to turn on my entire led ...
1
vote
2
answers
227
views
Array of Functions
I'm new to C++. How to make a menu without if() {} else {} & switch() case?
I made a menu on an array, but for some reason it doesn't compile. How to correct it?
typedef void (*cbd)(uint8_t, ...
-1
votes
2
answers
358
views
Char array filling with blanks
When I run this code, my pin and pinCheck arrays are not being filled with the results of keypad.getKey(). If I print the value at each index, the result is blank. As far as I can tell, I am either ...