Consider qualifying the intent of the user (direction and movement) by detection of all possible Quadrature Encoding values as show in this animated image from this wikipedia page.
Specifically, add tests for 0,0 and 1,1.
Further, if a fast rotary switch movement has been detected consider compensating for lag by assuming, after filtering out switch bounce,...
std::array does not use dynamic memory allocations to store its elements. If you use static or stack-allocated std::arrays, you don't have to worry about memory fragmentation (contrary to std::vector or String, for example).
Of course, if you allocate arrays on the stack, you can have a stack overflow if you call too many functions, either by design, or ...
I put my class files, [class].cpp and [class].h, in the same folder as my project.ino file, at least during development. Then, if they're sufficiently general, I'll move them to [workspace]/libraries/[class]/ for future use.
But even if they're only for this project (so they might as well stay in the project's source code folder), it's good organization to ...
With Sloeber Eclipse plugin the ino files go to root of the project and the cpp, c and h files can be in root or in subfolders. example:
Folders created by Sloeber: core subfolder is a virtual folder with links to Arduino core files and variant files of the selected board. libraries folder is a virtual folder with links to libraries selected for the project....
Leaving this here in case anyone else has a similar issue as an "answer" to my own question:
Simply put - DHT11 library as used, and MQTT library as used conflict. That's it, that's the answer.
There are two options for correcting this depending on your needs:
don't use or deeply examine and rebuild one of the libraries - frankly this was a negative ROI ...
I back up Michel Keijzers' suggestion to use a plain array, especially
given the tiny amount of RAM in your MCU (only 256 bytes).
Concerning the removal of items from the list, and given that your list
will be 16 bytes at most, you don't need to get fancy: just move back
the items that are past the one you removed. It will not take long.
Here is a ...
I don't think that this library is supported by attiny (or even Arduino in general).
However, beyond that, it is not advised to use it, since it is uncertain how much memory and flash overhead it consumes.
Especially the memory is an issue for two reasons:
Internally, you don't know the exact data structures used for the list. In most efficient way, it ...
I see two issues with this program. The first one has already been
pointed out by Majenko in a comment: you are doing too much floating
point calculations. The second has to do with the way your Phasor
manages the time.
If you take a look at the Blink Without Delay Arduino tutorial, you
will see something along these lines:
if (currentMillis - ...
Seems like you are using the system clock micros() to calculate elapsedTimeMicros, so probably the time spent on the process of calculation and sending signal to the pin may affect it, which may lead to inconsistent duty cycle.
i've tried many solutions to make it work but it just didn't and here are the solutions i tried
a) to use 0.1µf or 10µf between VCC and ground pin of the 74hc595 .
b) to set the clockPin and dataPin zero before sending data .
c) replacing the resistors from 220 ohm to 470 .
however, i connected pin13 of the 74HC595 to an arduino pin and drive it ...