Tagged Questions
0
votes
0answers
5 views
Data error in dynamic object array in arduino
Currently I'm using Arduino for my project and what I want is to have an array that stores an array of sensors. I do understand that there's limited resource to be used for a dynamic array. But by ...
0
votes
1answer
34 views
Identified amplitude in secret knock project
I'm doing project like this http://grathio.com/2013/11/new-old-project-secret-knock-drawer-lock/ The project only process time interval between knock, and I try to add amplitude as input, if I just ...
0
votes
2answers
29 views
Passing array of uint8 to function reduces its size (c++ code) [duplicate]
I'm having trouble with some code that I'm writing using the Arduino IDE.
The problem I'm having occurs when I try to pass an array of type uint8_t of length 12 to a function. When passing the ...
0
votes
2answers
19 views
Fetching a 2 dimensional array from a 3 dimensional array in Arduino
I'm currently trying to assign to a 2-D array from a 3-D array using the random function. As such:
byte blocks[7][4][2] = {{{0,0},{1,0},{2,0},{3,0}}};
byte currentBlock[4][2] = blocks[random(0,6)];
...
0
votes
1answer
25 views
Creating array of class objects of varying sizes
I have several sprite objects of different sizes I would like to turn into an array, but cannot get the declarations right. Nothing I search for seems to cover this particular situation.
How do I ...
0
votes
4answers
42 views
Need help creating a boundless array for Arduino (c/c++)
I'm trying to make an arduino copy of Simon Says, the kids game where you press the colors in the same succession they appeared before, with a Joy Stick for an independent study at school. I think ...
1
vote
1answer
37 views
Arduino - Serial.read() cannot read two digit data?
I made a 7 segment through led to a 74ls48 ICconnected toGizduino(mini) w/ ATmega328. I wanted to count from0-10usingjava-to-arduino.`
This is the code for Java:
public class Main extends ...
0
votes
2answers
37 views
“error: expected unqualified-id before numeric constant”
I couldn't find a solution to this error that seemed to match
I'm very new to arduino and am trying to make a set of 5 LEDs light up as the potentiometer
I'm editing the ifstatementconditional ...
0
votes
2answers
42 views
C : Arduino : Check to see if all the values in an array are larger than x and set them to zero
what I'm traying to do is : if any of the values stored in the elements of the array are larger than 2 , set the value of that element in the array to zero
int colom[] = {
...
0
votes
2answers
29 views
Calling child member from Base/Parent array?
So, I have a base class and a child class. Something like
Class Device
{
double read();
}
Class Relay : Public Device
{
void toggleSwitch();
}
Class Sensor : Public Device
{
int ...
0
votes
1answer
56 views
arduino assign values to multidimensional array
I have an arduino project which uses a 2 dimensional array to track row/column info. If I try to assign a row,column pair to a particular element I get an error:
expected primary-expression before ...
3
votes
1answer
62 views
Send long array to arduino over serial from processing
So i build an 24x16 (hight of 16, length of 24) LED matrix and am using an Arduino Uno to control it. It is only a one color matrix and i am using an array to store all of the bits of data.
This is ...
0
votes
2answers
70 views
Simple arduino program
i wrote simple arduino program to check a an array of ascii characters. Here is the program
void setup(){
Serial.begin(9600); // connect serial
}
void loop(){
char inByte;
char arr[100]={0};
...
0
votes
2answers
52 views
Why are only the last letters from these strings being printed?
I was curious to see if the Arduino Leonardo's keyboard and mouse libraries could possibly be used as a windows user password brute force hacker. Using my limited hobby coding and arduino skills i ...
0
votes
2answers
55 views
How to create an array of variables Arduino
How would i go about creating an array of variables such as.....
int incColor, c0, c1, c2, c3, c4, c5 = 0;
int circleArray[11][9] = { {c5, c5, c5, c5, c5, c5, c5, c5, c5},
...
-1
votes
1answer
38 views
Twodiemensional Array of booleans in PROGMEM(AVR) on arduino
I'm trying to construct an two dimensional array on an arduino uno which uses an atmega328. I want an array of booleans with the size of 256 * 18. This is to big for the 2KB RAM so i wanted to save ...
1
vote
1answer
35 views
Arduino - only first object loses its data property value when contained in a collection/array in another object
Consider the following code for Arduino. It compiles and runs but does not provide the expected output.
class Item {
private :
int val;
public :
int get(){
...
1
vote
1answer
52 views
Arduino integer array returns value of 3 for index 0 always
I wrote this sketch to send codes to a speakjet sound processor. It will store any number of three digit integers from 128 to 254. I type them into the serial monitor and hit enter after each one. it ...
0
votes
3answers
93 views
Arduino C++ class with arrays
I'm building a class that should have an array in it. I'm currently trying to pass an array, but the array can be any sized. When I try to do that, it doesn't work. Does anyone know how to do it?. ...
0
votes
1answer
37 views
parsing a string then storing in array to recall into a variable arduino
i am sending the following data to the arduino over serial:
c1:255c2:0c3:0c4:255c5:0
i need to separate this into 5 variables, so it will eventually become
val1=255
val2=0
val3=0
val4=255
val5=0
...
1
vote
1answer
86 views
Arduino: initialise custom object in constructor
I've created 1 library with 2 classes. Class Wave and Class LEDLamps. In the second class constructor i'm trying to populate a array of first class objects without any luck.
Here are some parts of ...
0
votes
3answers
106 views
How to access an array element by using a scalar variable in C?
I want to use an element of an array (in this case element 3) as a loop variable giving it a simple name like "c".
(This code is for the Arduino, but should look similar in standard C.)
The question ...
0
votes
1answer
226 views
variable array size at arduino
I have an SD card which I filled with 15 mp3 tracks and a text file that has 15 words and 15 tracks names. My question is regarding initializing the following
char* words[ ]
char* tracks [ ]
When I ...
0
votes
2answers
49 views
Indexing issues with arrays
The code I have fills an array of size 5 with 5 different values (code not shown). It then populates each index in the array with a corresponding number (bottom function). It then saves the previous ...
1
vote
1answer
109 views
Issues with declaring and writing to arrays with Arduino and C++
I'm messing around with an Arduino board for the first time.
I have an array declared like this (I know don't judge me), it's for storing each character of the LCD as a sort of cache:
char* ...
0
votes
2answers
59 views
Color sequence Arduino in multidimensional array
I'm trying to store a sequence of RGB values in a multidimensional array:
void loop()
{
short colors[][3] = {{2,2,2},{4,4,4},{4,4,4}};
for(int i=0;i<10;i++)
{
Serial.write("Debug 1");
...
1
vote
2answers
280 views
Send values from arduino to Highcharts
I am trying to send data from my arduino to Highcharts via ethernet following this two tutorials:
1.http://startingelectronics.com/tutorials/arduino/ethernet-shield-web-server-tutorial/SD-card-gauge/
...
0
votes
1answer
464 views
How do i store a byte array in Arduino flash memory using PROGMEM?
Hello everyone i am new to the world of Arduino and i am having problems storing temporary values in Arduino RAM so i thought i would store them in flash storage using PROGMEM.
i am trying to store 2 ...
1
vote
3answers
69 views
Concatenating chars from a char array into one integer
I've been trying to create serial motor controller from an ATtiny 85. I have it setup as a slave. It receives chars from a master one byte at a time and loads them into a char array for parsing.
...
1
vote
2answers
2k views
Two dimensional array / initialize data in c++ (Arduino)
I think I lost my whole C++ knowledge...
What I want is to initialize a 2D unsigned char array in a proper (readable) way:
My approaches:
#define RADIO_ONOFF 0
#define RADIO_P1 1
#define RADIO_P2 2
...
0
votes
2answers
148 views
error: expected primary-expression before '{' token
Someone of you can help me with code issue? I got the generic compiling error:
error: expected primary-expression before '{' token
with this part of code code:
for (int i=0; i<2; i++) {
...
-2
votes
1answer
106 views
brace initialized function pointer array: invalid conversion from 'void (*(*)())()' to 'void (*)()'
In my arduino sketch I need an array of function pointers with the signature void foo().
I'm using the ino command line utillity on linux (which uses avr-g++ under the hood).
However I'm getting a ...
0
votes
2answers
1k views
Struct and arduino
I´m trying to use struct with Arduino and I´m a beginner and I don´t know how to declare an array inside the struct and use it (int pin[5] and int vecinos[6]).
Thanks!!!
Lucía
typedef struct
{
int ...
1
vote
1answer
133 views
How to use a #define statement in order to set an array of bytes?
I am programming Arduino and I would like to use a #define statement in order to set an array of bytes to be passed to the Ethernet.begin() function. At this time I am using the following code and all ...
1
vote
3answers
128 views
Check if char is existing in array
I am creating project in arduino.
In C. How can I check if return char is existing in my array?
This is how I want it.
char n[20];
char *adminName[] = {"Jane", "Joe", "James"};
I want to return ...
2
votes
5answers
97 views
Can I have a single-dimension array of booleans that skip indexes?
I'm pretty new to Arduino programming, but am getting the hang of it. I've got a pretty strong PHP & Javascript background, so that's where I'm coming from.
I've been working on a project with an ...
0
votes
1answer
2k views
Two Dimensional Array in arduino
I am trying to make buf[] two dimensional array i am not getting any error but its not outputting anything to the screen.
int LoadImage(const char getFileName[],int width,int height, int xPOS, int ...
1
vote
1answer
559 views
Arduino (C/C++) Code To Display Contents of Array on LCD
I've tried to do as much researching as I could before posting this, but I am new to programming, so my general ignorance is at this point preventing me from really being able to know how to ask the ...
0
votes
2answers
1k views
Creating an Array of Strings from miscro SD Arduino
I'm involved in a project where i need to READ data from a "csv" file and then i need to storage this information in an Array of Strings in order to search, write, delete and add information after the ...
0
votes
1answer
99 views
How to return a byte array of unknown size from method
I have a class that parses some incoming serial data. After the parsing a method should return a byte array with some of the parsed data. The incoming data is of unknown length so my return array will ...
0
votes
1answer
145 views
How to mirror an array with WS2801 LEDs?
I have the following code http://pastebin.com/25ugwNhK# which basically reads the equalizer color values for 7 differenece frequencies and maps them to a color. Then mirrors them projected on a ...
1
vote
1answer
2k views
How to use lcd.write with String Array in Arduino
My code fragment is
String item[] = {"Hello","How","Where"};
int slot[] = {2,0,0};
i=0;
String t = item[slot[i]];
lcd.write(t); //This gives error
How to eradicate the problem. I am a ...
1
vote
0answers
128 views
Serial string problems
I am very new to programming the arduino, but I have been given a pretty complex task to undertake with it. My classmate is writing a program in visual basic for Windows. My program is to work in ...
2
votes
1answer
447 views
Working with arrays on Arduino in C++
I'm trying to manipulate arrays, but I'm a little confused with I need to do. I want to do something like:
char myArray[10];
myArray[0] = 0xA9;
myArray[1] = 'D';
myArray[2] = 'S';
myArray[3] = ...
0
votes
1answer
515 views
How to setup a associative data structure in Arduino
I'm just developing a small remote control which lets me control my IR controlled devices via the Internet. All is working, but I still need to store the codes in a way that I can easily access them. ...
1
vote
2answers
702 views
Arduino: cannot get value from array of struct
I have a bidimensional array of struct that I defined and I want to get a value in a struct which itself is contained in an array.
I have tried to do the same kind of code in bare C and it seems to ...
0
votes
2answers
282 views
Adding a colon (:) to an unsigned char in C++
I am writing an Arduino library for simple data transfers between the Arduino and a computer using a serial feed. I have created the library, etc. However, I am having issues with taking a char array, ...
1
vote
1answer
2k views
Arduino EEPROM write and read array?
When the Arduino is powered up it has an int array stored in the flash, for example:
int secretCode[maximumKnocks] = {50, 25, 25, 50, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
When the ...
-1
votes
2answers
1k views
Passing Arrays In a Library Arduino
I am trying to write a library that reads 5 variables, then sends them through the serial port to a bluetooth reciever, I am getting a number of errors and I am not sure where to go from here, do I ...
0
votes
2answers
582 views
Convert 8 bytes uint8_t array to 4 bytes array
I am using Arduino and I want to save the XBee MAC (upper and lower bytes) in an uint8_t array.
Now I am reading bytes without problem but I am saving them in an uint8_t* array using 8 bytes.
I want ...