Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
113 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 ...
Noel's user avatar
  • 155
0 votes
1 answer
2k views

Getting error invalid conversion from 'const char*' to 'const uint8_t*

I have written this sketch, and I am trying to populate the array of wifi hotspots to set the value in html select using javascript dynamically. #include <Arduino.h> #include <Hash.h> #...
Ciasto piekarz's user avatar
1 vote
1 answer
10k views

Length of uint8_t* const array

I've an array of type uint8_t* const with 6 items, defined like this uint8_t* const neighbourSet[] = {PEER1, PEER2, PEER3, PEER4, PEER5, PEER6}; Whereas each element in this array is static uint8_t ...
Anum Sheraz's user avatar
0 votes
2 answers
56 views

Error array value after passed to a function

I would like to ask about a weirdness in my program. This is my program: void setup() { Serial.begin(9600); } void loop() { workout_Text(); } void workout_Text() { int woT_x[] = {1, 4, 8, 12,...
Zahi Azmi's user avatar
  • 139
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 ...
R1S8K's user avatar
  • 283
0 votes
2 answers
5k views

Max length of char arrays?

I'm running the following Sketch on my Arduino Uno: const boolean verbose = true; void debug(const char *s){ if(verbose){ char buf[8 + sizeof(s)] = "[DEBUG] "; strcat(buf, s); ...
tr01's user avatar
  • 117
0 votes
1 answer
2k views

Set array to array passed as parameter in constructor

I have a constructor which looks like this: Preset::Preset(char* presetName, MIDICommand* MIDICommands[]) _presetName = presetName; _MIDICommands = MIDICommands; } _MIDICommnads is declared like ...
ptf's user avatar
  • 111
2 votes
0 answers
91 views

Arduino -> Processing conversion: creating mux channels

As the title alludes to, I'm in the process of converting an Arduino sketch to a Processing sketch. So far, mostly pretty straightforward. I'm running into an issue with creating an array of ints for ...
narner's user avatar
  • 267
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] ...
William Roy's user avatar
3 votes
3 answers
25k views

How can I concatenate multiple byte Arrays into one Array

I have three byte arrays. I first change their values during runtime and after that I want to combine them into one bigger 4th array. byte a1[] = { 0x01, 0x00, 0x01 }; byte a2[] = { 0x00, 0x11, 0x01 }...
William Roy's user avatar
1 vote
2 answers
278 views

Push to 2D array (log) but last value pushed is everywhere

I have this simple that is supposed to keep a log for me with a fixed number of entries. When I add to the log the oldest replaced is by the second oldest etc and the new entry added. Except when I ...
Thomas R. Koll's user avatar
0 votes
1 answer
109 views

Pass custom element of an array from an inherited class to main sketch

I'm building a base class that creates color patterns using FastLed's CRGB structure. I use the base class as inheritance for another more specific class that modifies a vector of colors (Pixels[]) ...
Luis Ferreira's user avatar
0 votes
1 answer
2k views

Storing integer into character buffer

I have my Arduino code as below.I am trying to send Serial request and get response for it. I can able to send request mentioned in Setup function and also able to switch cases. Problem i am facing ...
AMPS's user avatar
  • 467
0 votes
1 answer
4k views

Arduino: put string through variable in array

I have a problem and I can't fix it. I'm busy with an java to arduino project. Java writes a string using writeString(); Arduino reads the serial monitor and put the incoming string into a function. ...
Dennis's user avatar
  • 103
0 votes
2 answers
8k views

How do I pass an Int Array into void for a foreach loop?

I know its probably an odd question...but I found a workaround for a foreach loop in C. I have a whole bunch of int arrays that I would like to be able to pass into a void, which has that foreach loop ...
mr-matt's user avatar
  • 147

15 30 50 per page