All Questions
Tagged with class arduino-uno
10 questions
1
vote
2
answers
262
views
Public variable in class not incrementing
I'm not sure what is wrong with my code, but whenever I call addNewLine, the linesInserted variable is not updating correctly. When I print the value of linesInserted inside of the addNewLine method, ...
1
vote
1
answer
102
views
Class help - Same Object types seem to mix values with each other
I'm having issues with two objects of the same class type. I have a LED class, which has functions to fade in and out, a LED. In my code, I create two objects of this class, and on the board, I fade ...
0
votes
2
answers
187
views
A class within a class - via an Initialiser Lists: NOT able to update a variable
My test are based on the blog of http://arduinoetcetera.blogspot.be/2011/01/classes-within-classes-initialiser.html.
Because I would like to use this idea, I tried with a simple idea, after the ...
1
vote
1
answer
3k
views
Avoid global variables with classes
I want to avoid global variables when using my own classes in Arduino. Here is a example.
void setup(){
/* setup here */
classA objectA;
}
void loop(){
objectA.someMethod();
}
I know that my ...
0
votes
3
answers
2k
views
Initialize a class (HX711) within a class with constructor and parameters
I am far from being an Arduino specialist, so please bear with me if some of my code below is far from correct.
I am writing a sketch in which I need to use 3 instances of the HX711 library, as I am ...
0
votes
1
answer
336
views
Possible Arduino Uno c++ compiler bug?
I recently gave the students in my Arduino-based programming class a project to write some simple unit tests and fix the bugs that they encountered as they did. The class in question mostly stores a ...
0
votes
1
answer
823
views
Use object of LiquidCrystal class within another class
I am quite new to C++ and hope that I don't bore you too much with my question.
I want to use an object of LiquidCrystal Class in another class called "Display_ManagerClass". I followed the ...
1
vote
2
answers
10k
views
Arduino declaring class in h and cpp file Undefined Reference
I am trying to compile my project, but unfortunately get errors.
I created class and separated implementation and declaration (cpp file and h file)
Here they are
sensor.h
#ifndef SENSOR_H
#...
0
votes
1
answer
2k
views
Can't use base class and derived class functions
I have made two libraries and one test program.I have made my custom uart library.first i have included all functions for printing in single uart library file.but then i have made print library for ...
7
votes
1
answer
1k
views
Arduino Servo won't move when using classes
I'm trying to make a class work with Arduino, however it doesn't seem to trigger properly. The code is compiling perfectly, and it's supposed to control the leg of an hexapod. Also, the example sweep ...