Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

0

I'll try to find such PC app, but I can't find anyone. When I give up to find such app, I wrote my own arduino emulator via qt. My app is include arduino app and compile them as part of the qt app. Thank's to #ifdef macros i'm change the arduino.h . My emulator is not let you add scheme elements, but add you advantage to watch pin states and sets values to ...


0

Ok, after reading and reading the answers and links about my question, I ended up using a function as suggested. Something like: void foo(char* myArray, int size) {} But I ended up finding another solution to the problem, which is a little more complicated: #define arrayLen(x) (sizeof(x) / sizeof(x[0])) char myArray[64] = "my array test with a long value ...


1

The C arrays are tricky and they're described in every C tutorial. The other answers adresses mistakes / questions in comments, but none of them shows how it can be done: struct BuzzNote { int note; int duration; }; const BuzzNote melody[] = { {10, 200}, { 45, 300}, {90, 200}, // ... }; void test(BuzzNote const * arr, size_t len) { for (size_t i = ...


1

This is more of a general programming question, but since there are some special pitfalls for microcontrollers/Arduinos I will answer the question. How can I declare an array without mention its size, fill it up with as many indexes I want, then pass it to a function that will be able to process all the contents? Short answer: You cannot. An array has ...


3

BUZZER_NOTE notes[]; //-- Funny how the same declaration tried below DOES work if it's inside a class It doesn't really. C++ language prohibits that. It is just a non-standard quirk of GCC compiler used by Arduino IDE, which happens to support C-style flexible array members in C++ code. // BUZZER_NOTE notes[]; //-- Compilation error: Of course. You ...


1

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 ...


1

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 ...


Top 50 recent answers are included