All Questions
14 questions
1
vote
1
answer
266
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 ...
1
vote
1
answer
929
views
using a variable to index an array
I'm using the keypad library to return a number 1-9. (im fairly sure this returns an int)
I have an array (data) showing the state of each button press.
so i would like the number returned by the ...
0
votes
2
answers
304
views
Assigning array variables to int variables
I need to control thousands of rgb leds.To make animations I want to assign led numbers(addressable led strip) to arrays.For example floor[2]room[14]=106 106 is the number of led,there are many floors ...
1
vote
3
answers
7k
views
Do some variables not hold their value when a while loop is exited?
Sorry if i'm asking too many silly questions but i'm really stumped on this one. I understand if I set a variable inside a loop that that variable won't be within scope from the outside of the loop.
...
1
vote
2
answers
1k
views
How can I declare global array with its length stored in EEPROM?
I am working with Arduino UNO connected with BV4612 display.
I am working on a simple code that controls several water pumps. Each pump has several modes it can run in. I store these modes in an array....
0
votes
2
answers
6k
views
Fill an Array with Values
I have a function in which I change the pinMode on many of my Arduino's pins based on a passed in mode. I first construct an array of bytes specifying each pin to be an input or an output and then I ...
0
votes
1
answer
9k
views
Why using static volatile for variables and only static for arrays in TWI library?
I want to know why to declare variables with static volatile and arrays with only static in TWI library?
For example;
static uint8_t twi_masterBuffer[TWI_BUFFER_LENGTH];
static volatile uint8_t ...
0
votes
1
answer
258
views
Error declaring two-dimensional array: 'x' was not declared in this scope
I'm trying to declare a 2-D array where each letter in the alphabet is keyed to a corresponding LED in my LED strip. But when I try to declare the array, Arduino flags the values and gives me a "not ...
0
votes
1
answer
967
views
Space needed for local String variable
I tried to run this code on my Arduino Uno clone (which has no function so far and is a shortend version of my programm):
String rules [16][5] ={
{"B0 B5", "", "", "cs S0", "", },
[...]
};
...
0
votes
2
answers
412
views
Is it ok to declare variables inside timer interrupts?
I am building a real time audio application using the Arduino DUE. This application needs big arrays like:
uint16_t sDelayBuffer0[46000];
The Due has only 96kb of RAM available so this array just ate ...
5
votes
3
answers
1k
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(){
...
0
votes
2
answers
153
views
What is the opposite of this data operation?
If I store in an array a double-value in this format, in which format I should be able to read the same double out?
double myDouble = 12.123456;
byte myArray[] = {0x00, 0x00, 0x00, 0x00};
myArray[0] ...
0
votes
1
answer
5k
views
Best way to assign value to lot of variables
I'm building web based remote control system for esp8266. In arduino IDE, using the ESP libraries. To, send data to the server, I'm using http post.
For some settings, I need to transfer 30 or so, ...
1
vote
2
answers
2k
views
Append Text to Variable Names: Please Help Me Shorten This Code
I'm trying to shorten the code under "setup" below, where I have over 120 variables that are being read from an external EEPROM. There is a pattern where the variable that stores the position of the ...