Refers to code that present variables in the form of an array.
1
vote
0answers
17 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 ...
0
votes
2answers
41 views
Does int array[100] = {0} contruct 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
vote
2answers
44 views
Initializing pointer to vector of objects inside another object
i want to create a somewhat complex structure of classes in an arduino. The short story is: a Device has Presets, and each Preset has a Patterns. For that i created the following structure (i am only ...
0
votes
3answers
74 views
Not understanding C++ arrays
I'm attempting to re-write a library for the CD74HC4067 multiplexer. There is a library available for this device on the Arduino Playground, however, it's limited in its functionality.
I have this ...
0
votes
2answers
58 views
Fastest communication between Arduino and PC
I am using an Arduino 2 which collects data from a set of microphones and stores it in an array of unsigned short of 40000 elements and sends them to the PC via Serial USB.
It is working but I'd ...
0
votes
2answers
52 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
1answer
40 views
How to filter incoming Serial Data into Arrays?
I receive Serial data in the following format:
whdysAB1212jdc8eu3wAA11djnsAC1231232yhcbAA00 ...
There are three different data pack types identified by their beginning: 'AA', 'AB', 'AC'.
Everyone ...
0
votes
1answer
45 views
Serial parsing strange data
I have a project where I use a software serial connection to read serial data from a barcode scanner.
All is good. However from time to time I have some problems with the data that I'm receiving.
...
0
votes
3answers
97 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 }...
0
votes
2answers
37 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 ...
1
vote
0answers
75 views
ATtiny Mapping PPM Inputs to Move Servo Issue
Short Version:
Not able to get a servo to move to mapped input from RC remote control PPM signal.
Detailed Verison:
I am trying to take an input signal from a hobby RC radio (D4RII receiver ppm ...
0
votes
1answer
75 views
Storing latitude and longitude floats as chars with specified precision
I am receiving lat and long data from a GPS and want to store these numbers in the middle of a sequence of chars.
E.g. lat = -23.123456
long = 135.123456
I am after something like "Your coordinates ...
0
votes
1answer
80 views
Mapping PPM Signals to Servo Values
This question is an extension of this question.
Accessing Values From Array Within a Library
The answer provided by Mark showed me how to read and print a single value from a particular array by ...
1
vote
1answer
60 views
Accessing Values From Array Within a Library
There are many great examples of how to access information from an array on the net. I ran into a specific case that has me confused. I am using a library for attiny 85 TinyPpmReader.h. This is a ...
0
votes
4answers
46 views
Digital Reading from a array without using the exact element
Is it possible to read a digital input from an array without using the exact element? Such as
while(digitalRead(myButtonArray[i]))
digitalWrite(myLEDArray[i], HIGH);
Reading the ...
0
votes
1answer
56 views
About Arrays in Arduino
I have a question about arrays in Arduino. Sorry for my bad English.
I want to put numbers in an array, and I think the code below works properly.
However, it doesn't work and corrupted numbers show ...
0
votes
1answer
32 views
Array variable name changes from readings1 to readings2
I've been using two MB1240 Ultrasonic Sensors with analogRead, and have found that after using bubble sort, the array is found in array readings2, and not readings1. This is important because I would ...
1
vote
0answers
32 views
Erratic behavior from 'randomly' generated values in array
Currently working on a data collection algorithm on the Arduino MEGA (ATMega1280) and I've run into a problem with some of the code I've written. I feel my problems may be stemming from the way in ...
1
vote
1answer
33 views
Using 2D servo array in my class
I need to use a servo library in my class.
I read this question - Use object of other class within class and it works fine for my LCD application, but now I need to use a 2D servo array in my class. I ...
0
votes
1answer
35 views
two dimensional array with 3 characters per entry?
my plan is to create a two dimensional array with 3 characters in each cell.
what i have tried:
char keys[3][8][8] = {
{' ','4','5','6','x','/',' ',' '},
{'x10','7','8','9',' ',' ',' ',' '},
{'...
1
vote
2answers
43 views
arrange vector in descending order
im trying to arrange the vector in descending order but its not happening..
int fibonacci[15]={0, 1};
int a=0;
void setup() {
Serial.begin(9600);
for (int i=0; i<=14; i++) //loop to create ...
0
votes
1answer
79 views
Shrink array to save memory
In my project I need three arrays to store data inside.
I define a maximal number of elements as a macro variable. However, at a certain point in the setup function, the program could determine, that ...
1
vote
1answer
54 views
Arduino SSCANF stop on comma delimiter
I have the following problem, the arduino is receiving a command like
LCD,Display line text one, Display line text two
I use an strcmp to match the beginning of the string that works but now I would ...
1
vote
2answers
35 views
How to keep track of if data is outdated
I have a large set of data and it is refreshed every 30 seconds or so. However, not all data is refreshed every time. It is possible that no new data for a particular calculation isn't received for ...
6
votes
2answers
211 views
Replacing several pinMode() and digitalWrite() pins with an array
I'd like to 'clean up' some code that involves several pinMode() and digitalWrite() lines by using a single line of an array. I'm very new to both arrays so I'm a bit confused. The following examples ...
0
votes
3answers
662 views
Returning an int array from a function
I have a function that needs to return 3 int values. I currently use an array declared in the global scope and I ask the function to write into them. Is there a way to make a function return an array?
...
0
votes
1answer
54 views
How can I use an arduino as an intermediary step between my PC and a LED strip?
Goal
My end goal is to have a NeoPixel LED Strip that I can control via software on my PC, with various automatic modes and manual control. Right now all I have is the idea and some research done, ...
1
vote
2answers
32 views
Function only taking the first 4 elements of a character array
I'm writing a function for my arduino program that takes a character array of any size and will mark all the characters that aren't in the alphabet by changing their value to '1'.
I have a switch ...
0
votes
1answer
35 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[]) ...
1
vote
2answers
41 views
Object Array using Inheritance
I would like to create an array of a generic type so I can use multiple sensors and make my code as extensible as possible.
/*
Planning for good design. Agent library
should be able to use more ...
1
vote
0answers
47 views
RF24 - Split data in payloads at sender and then rebuild on receiving end
I'm trying to send some data using nRF24L01+ transceivers, but I need to use 8 byte payloads for reliability. The data I'm sending is much bigger than that, so I need to split it into 8 byte packets ...
0
votes
3answers
77 views
Arduino is freezing during Serial.Print() while passing a char array
This problem is on an Arduino Due.
I am trying to populate a char array buffer that is receiving information over a serial port. I am reading the information off of the serial port and storing it into ...
0
votes
1answer
164 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, ...
0
votes
1answer
89 views
MySQL Connector/Arduino insert data from row into an array
I'm new here.
These days I have been working with the MySQL Connector/ Arduino library. So, my problem is how can i retrieve a rows data so as to enable an output. I have written some code, which was ...
0
votes
1answer
468 views
Size of String array
I am trying to find out the size of an array like this:
String days[3] = { "Mon", "Tue", "Wed" };
Serial.printf("Size of array: %2d\n", sizeof(days));
for (int i = 0; i < sizeof(days); i++) {
...
0
votes
2answers
140 views
Using micros() to measure analogRead() time varies based on Serial.print location?
I'm trying to use micros() to measure the time it takes to execute an analogRead() cycle, but am having some issues. Originally, I just printed out the measured time for the analogRead() right after ...
0
votes
1answer
53 views
Passing array to library function
I'm trying to pass an array to a library (written in c++) but the error:
undefined reference to `MyLib::arrayTest(int*)'
collect2: error: ld returned 1 exit status
Error compiling.
Is being produced....
0
votes
3answers
184 views
How to pass a Static Cont array to a function
I'm implementing a voice synthesizer chip. To build a phrase, I create a list of phonemes like this:
static const uint8_t PROGMEM heybuddy[] = {
pPA5, pHH1, pEY, pPA5,
pBB2, pAX, pDD2, pIY, pPA5,...
0
votes
0answers
34 views
Casting values larger than 0x7F as a CHAR
I'm writing some code and came across an odd issue. I was writing a checksum routine that accepts an array of chars and returns a char as the checksum value.
I was testing the value returned by ...
0
votes
2answers
129 views
Dynamicly sized array as a class member
I want to create a dynamic sized array of chars as a member in a class.
This is being done inside a library that I've created.
I have the .h and the .cpp files created. I'm not sure how to declare ...
0
votes
1answer
517 views
Remove certain characters from char*
I've got an array of char* with serial data that I'm trying to remove ':' from. I have tried to iterate through the char*, find and remove any colons but it just comes out as garbage.
char* espData[...
0
votes
2answers
20 views
Extracting a specific sequence of characters from an array
I have a character array called storebuffer that contains data from a POST submission and its in the format ssid=abcdef&pswd=ghijk. I wanted to extract everything after ssid= into one array called ...
2
votes
1answer
57 views
Overwritten EEPROM
I have a problem with the Teensy, its EEPROM and another Array.
My program contains two Arrays, the first one is a 128x4 long Array, the other one a 2560x2 double Array. The first Array is meant to ...
-1
votes
1answer
127 views
Add string inputs into an array
I have been working on this a while and I cannot seem to figure it out. Essentially, I am using the app/server Blynk and their Terminal Widget to sent String inputs to my Arduino board. My code is ...
0
votes
1answer
40 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 ...
0
votes
2answers
22 views
Character array weirdness
I'm using Energia to program one of TI's MCU. Since Energia is based off the Arduino IDE, I'm hoping someone can help me here.
I'm building a simple UDP packet sender and receiver app. The MCU ...
0
votes
1answer
213 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.
...
0
votes
1answer
43 views
Building Multidimensional Arrays from simple arrays
Hi I am trying to write a functiont that will build a 2x4 array based on 2 1x4 arrays.
the two relevant functions are below. The first function gets information from some sensors and outputs it (I ...
0
votes
1answer
124 views
Is it possible to have an array of int arrays?
I have a huge number of arrays, each with a series of numbers each referring to an LED on a strip. I want to be able to address each one by a number, so the logical solution to that for me was to make ...
0
votes
2answers
261 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 ...