Skip to main content

Questions tagged [class]

A custom structure in C++ (and various other languages) which can contain member data and functions. An instance of a class is called an object.

0 votes
0 answers
147 views

I'm using the Arduino IDE (v1.8.19) with the Earle Philhower core to program a Raspberry Pi Pico (RP2040) board. I2C bus 0 of the Pico (pins 4 (SDA) and 5 (SCL) are coupled to a first MCP23017 port ...
-1 votes
1 answer
113 views

I'm experimenting with classes in Arduino code. I have the following small code snippet: #include "Motor.h" #include "Arduino.h" Motor::Motor() { } void Motor::Configure(...
2 votes
1 answer
135 views

I am trying to create a class (Arm) that controls an arm. The arms have 2 motors, each with an encoder, so I pass 4 integers for the pins and I am trying to pass 2 pointers (one for each encoder ...
1 vote
1 answer
3k views

In order to explain my problem I used 3 classes: Actions, Triggers, and Combine. Actions simulates an action function, that is defined externally. Triggers has that function that needed to be executed....
1 vote
0 answers
305 views

I'm trying to use a library function in my ISR function that uses the internal timer to trigger every 1 ms. The chip that I'm using is an ESP32-C3-MINI. Here is my current code: main.cpp #include <...
1 vote
1 answer
96 views

I'm having troubles understanding the inner workings of classes and such. I have a class called Attributes that contains parameters. In my .ino, I can simply instantiate an object with Attributes ...
1 vote
4 answers
1k views

I have a class with 12 instances of a button, to create a keypad( meaning that this is the only case I use 12 instances). But this class can be just a button array of any other number between 1-12. I'...
-1 votes
1 answer
364 views

I'm trying to creaper class wraper to use an Streamobject but I've an error when I try to compile. My .hfile : #include <Arduino.h> class TestSerialListener { public: TestSerialListener(...
1 vote
1 answer
152 views

I want to write a class for a model bike. For controlling the steering I use a DC motor with two encoders. To get the steering angle stAng of the bike, I attach a interrupt to the pin ST_ENC_A where ...
-1 votes
2 answers
1k views

I'm trying to create a small battery powered alarm clock using an Arduino MKRZero and a generic SH1106-controlled, 128x64 pixel oled. I started out just dumping all code into a single file named Clock....
3 votes
2 answers
3k views

I intended to use a timer interrupt for limited instances of a class in my ESP32 Arduino project. My first code conception was as follows: portEXIT_CRITICAL_ISR(&lock0); } ...
1 vote
2 answers
2k views

I am new to C++ & I need to call functions of one class from another class. And so that the classes do not know anything about each other. How to do it in Arduino environment? class Encoder { ...
2 votes
1 answer
2k views

I'm trying to create a class that uses attachInterrupt, but get this error msg: In member function 'void ledDoor::attach()': ClosetLedStrip:31:82: error: invalid use of non-static member function ...
0 votes
1 answer
150 views

Further to my previous question here Can anyone help me understand how the callback function gets revoked itself? The connect function, disconnect function. BLE custom UUID code source here Another ...
0 votes
1 answer
100 views

Theoretical Q I'm having some trouble when using a referenced variable in a class. Class A have an int a=0. Class B has an instance of Class A, and referencing int &a=A.a, and in the same manner ...

15 30 50 per page
1
2 3 4 5
9