Skip to main content
Thomas Weller's user avatar
Thomas Weller's user avatar
Thomas Weller's user avatar
Thomas Weller
  • Member for 7 years, 5 months
  • Last seen more than a week ago
  • Germany
comment
Call functions of one class from another class - Callback
@Andre: regarding OOM, I don't have much advise. Mainly avoid new (which I see you don't use, that's great). Next, avoid copies. Encoder encoder = Encoder(); could just be Encoder encoder;. (Yes, we have guaranteed copy elision in modern C++, but nobody really knows what C++ version Android actually supports)
revised
Loading…
comment
comment
How real-time is an arduino (react to sensor)?
@MyICQ: note that I accidentally calculated with kbits/s instead of bit/s, so I was off by a factor of 1000. OMG! See the new calculation. The whole data is sent at around the 3 o'clock mark
revised
Loading…
comment
How real-time is an arduino (react to sensor)?
@MyICQ: accepting the other answer is ok. I am not overly happy with the digitalRead() decision of that answer - probably because I had too many issues with digitalRead() not working reliably enough in my projects. Anyway, if the suggested code is roughly what you need, that's a fine answer.
comment
Call functions of one class from another class - Callback
Is there a difference between &myClass.onMsg and MyClass::onMsg? I don't think this provides an instance for the function to call. Otherwise you could call member functions and it needn't be static. (Side note: myClass with lower case m is not a class, it's an object; same for libraryClass)
comment
Call functions of one class from another class - Callback
@Andre: your design looks more like a C# or Java design. Be careful with that on Arduino. You may run out of memory if your designs are very sophisticated and your code is too PC-like.
comment
Call functions of one class from another class - Callback
@Andre: you're welcome. Once you have tried the suggestion and tested that it actually works for you, you may mark this question as solved by checking the checkmark beneath an answer so that others know they don't need to spend time on this any more. No need to hurry, take your time to check that it's really the answer you need.
revised
Loading…
Loading…
answered
Loading…
awarded
awarded
awarded
awarded
revised
Loading…
Loading…
comment
Connecting PC speaker to Arduino
Why is no resistor needed? I don't exactly know OP's speaker, but my speaker says 8 Ohm. 8 Ohm at 5V is much more than an Arduino can handle, isn't it?
1
3 4
5
6 7
12