Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: luni

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    29
    Views
    602

    So far I've used it only for 64bit variables...

    So far I've used it only for 64bit variables where this is the only way (I know of) to 'printf' them.

    @mjs513: funny how complicated a simple thing like printing an 8bit variable can get :-).
    ...
  2. Replies
    29
    Views
    602

    More tests with the PRIs void setup() { ...

    More tests with the PRIs



    void setup()
    {
    while(!Serial){}

    Serial.println("int64_t");
    int64_t test0 = -2;
  3. Replies
    29
    Views
    602

    Nearly :-). You also need to add spaces: ...

    Nearly :-). You also need to add spaces:


    void setup()
    {
    while(!Serial){}

    uint32_t test = 42;
    Serial.printf("Var: %08" PRIu32 "\n", test);
    }
  4. Replies
    29
    Views
    602

    PRIxN -> x is the usual u, d, x, X etc N is the...

    PRIxN -> x is the usual u, d, x, X etc N is the width of the variable.

    E.g.
    PRIu16 will print a 16bit unsigned
    PRId64 will print a 64bit signed
    PRIX32 will print a 32bit hex number with...
  5. Replies
    29
    Views
    602

    Tested with the code below. Works as expected. ...

    Tested with the code below. Works as expected.



    #include "EEPROM.h"

    struct GoodType // this is bytewise copyable
    {
    const char* text = "Good struct";
    float version = 1.54f;
  6. Replies
    29
    Views
    602

    Great, the EncoderTool...

    Great, the EncoderTool which depends on a current Bounce2 now compiles out of the box. Thanks
  7. std::chrono compliant, teensy_clock based on the cycle counter

    The last days I had a lot of fun exploring the std::chrono namespace which provides a new (well, >=c++11) abstraction of durations, time points and clocks.
    As an outcome of all this I implemented a...
  8. Cool, looks like the code generates pretty...

    Cool, looks like the code generates pretty stable 5Ás intervals even with the TCK (software) timer. I like them more and more since they are so uncomplicated to use. No hassle with atomic access and...
  9. Replies
    41
    Views
    823

    Here a PR for the EEPROM library which implements...

    Here a PR for the EEPROM library which implements a check for 'non usable' types and specializes the template to enable String storage https://github.com/PaulStoffregen/EEPROM/pull/5 See also here:...
  10. Replies
    41
    Views
    823

    Would it be possible to update Bounce2 to the...

    Would it be possible to update Bounce2 to the current version? The one packed with Teensyduino is quite outdated and misses some useful functions.
  11. manitou's Teensy 4 repository is an infinite...

    manitou's Teensy 4 repository is an infinite source of useful code snippets: https://github.com/manitou48/teensy4
    I didn't look into it but there are a few gpt_capture inos listed...
  12. You are very welcome. You should at least...

    You are very welcome.


    You should at least fix the two bugs with the wrong signature of your callback and the possible overrunning of your buffers. Typically not fixing such stuff bites back...
  13. %zu works for size_t

    %zu works for size_t
  14. Thread: Teensy MicroMod

    by luni
    Replies
    11
    Views
    424

    Wow, that is really great news. Do you plan to...

    Wow, that is really great news. Do you plan to stick to the Adafruit pinout? Any rough idea when this will be ready? I need to do a board in a couple of weeks, would love to use/test this form factor.
  15. Oh, thanks for the shout out. Hope the now...

    Oh, thanks for the shout out. Hope the now increased user base won't find too many bugs :-)
  16. Just for the fun of it (and since I'm somehow...

    Just for the fun of it (and since I'm somehow biased :D), here a solution using a software timer from the TeensyTimerTool



    #include "Arduino.h"
    #include "TeensyTimerTool.h"
    using namespace...
  17. I had a quick look at your sketch. Looks like...

    I had a quick look at your sketch. Looks like there are a couple of bugs in it.

    1) The Arduino-Timer I found (https://www.arduino.cc/reference/en/libraries/arduino-timer/) expects a bool...
  18. You can also use the utility to define...

    You can also use the <atomic> utility to define atomic variables as shown here:


    #include<atomic>

    volatile std::atomic<uint32_t> myAtomicVar; // define a uint32_t variable which ensures that...
  19. Replies
    6
    Views
    199

    Actually I tested this on my old computer which I...

    Actually I tested this on my old computer which I bought used some 3 years ago (i5, 2.9GHz, 6GB). It doesn't even have USB3 and is crammed with stuff accumualted over the years. Zoom and Teamviewer...
  20. Replies
    6
    Views
    199

    I did some more experiments on that with a (at...

    I did some more experiments on that with a (at least for me) surprising result: I always assumed, that some PC application needs to actively read the HID reports to 'remove them from the bus'. This...
  21. Replies
    6
    Views
    199

    The descriptor in usb_desc.h sets the poll rate...

    The descriptor in usb_desc.h sets the poll rate already at the minimal value 1 which corresponds to 8kHz (125Ás) for an USB-2.0 device. To test it, I did the following quick experiment with a win10...
  22. Replies
    8
    Views
    322

    In case you want to give the TeensyTimerTool a...

    In case you want to give the TeensyTimerTool a try, here some working code using the GPT timers. It uses a second (one-shot-)timer to reset the pin which avoids waiting 10Ás in the ISR. GPT clock ...
  23. Replies
    8
    Views
    322

    Yes, you can select the PIT/GPT timer input clock...

    Yes, you can select the PIT/GPT timer input clock (24/150MHz) and the TMR timer prescaler (1..128) in the config file. At minimum settings (GPT/PIT = 150MHz, TMR presaler = 1 and TCK @600MHz) you ...
  24. Thread: TeensyTimerTool

    by luni
    Replies
    220
    Views
    10,829

    Just a quick update to the TeensyTimerTool: I...

    Just a quick update to the TeensyTimerTool: I managed to define my own frequency types and added the corresponding literals to the periodic timer begin functions. In addition to plain microseconds...
  25. Replies
    22
    Views
    491

    It's slots

    It's slots
  26. Replies
    22
    Views
    491

    Don't know if tonton had his library added to the...

    Don't know if tonton had his library added to the library manager. You can always download it from github (link in #2) and either zip install it with the library manager or simply unzip it to your...
  27. Replies
    22
    Views
    491

    Not really (but the effect would be the same). ...

    Not really (but the effect would be the same).
    Don't get confused by this index variable. It defines which of the three buffers you are writing / reading to. It has nothing to do with the position...
  28. Replies
    22
    Views
    491

    Great! Thank @tonton81 for his useful library the...

    Great! Thank @tonton81 for his useful library the rest is just boiler plate code... Have fun with it :-)
  29. Replies
    22
    Views
    491

    Ok, you'd still need one buffer for each value...

    Ok,
    you'd still need one buffer for each value you want to delay. Alternatively you could store structs in the buffer but that will complicate stuff unnecessarily. It is easy to pack the stuff into...
  30. Replies
    22
    Views
    491

    No, in this line Circular_Buffer

    No, in this line



    Circular_Buffer<int, 1024> buffers[3];


    I declared an array of 3 separate circular buffers, one buffer for each value. In the shown nested for-loop I write 'delta' times...
  31. Replies
    22
    Views
    491

    I think if you need to do measurements and...

    I think if you need to do measurements and calculations of multiple sensors at a rate of 600kHz the delay line will be your smallest problem. Anyway, here an example how you can measure -> calculate...
  32. Replies
    5
    Views
    325

    Are you confused that you don't get 223.98 back...

    Are you confused that you don't get 223.98 back or that println and printf give different results?

    In the first case:
    Most floating point numbers can not be stored correctly in float/double...
  33. Replies
    22
    Views
    491

    Actually it is quite simple to use. Here a quick...

    Actually it is quite simple to use. Here a quick implementation using this ring buffer.




    #include "Arduino.h"
    #include "circular_buffer.h"

    Circular_Buffer<int, 1024> buffer; // use 1kB...
  34. Replies
    22
    Views
    491

    The simplest might be to use a ringbuffer (aka...

    The simplest might be to use a ringbuffer (aka circular buffer) https://en.wikipedia.org/wiki/Circular_buffer. @tonton81 has a nice implementation for Teensies here...
  35. Since you are using VisualTeensy I recommend to...

    Since you are using VisualTeensy I recommend to install the new version which I just released. It uses gnu nm to generate a nicely sorted *.sym file. Should be quite easy to check if something...
  36. Replies
    210
    Views
    17,870

    Since vscode >1.5 spits out annoying messages...

    Since vscode >1.5 spits out annoying messages about changing intellisense mode from gcc-x64 to gcc-arm I updated the corresponding configuration and added a few other improvements to VisualTeensy

    ...
  37. Thread: TeensyTimerTool

    by luni
    Replies
    220
    Views
    10,829

    Compatibility to std::chrono::duration

    I recently stumbled over c++14 std::chrono::duration and its corresponding user defined literals (e.g. ms, h, ns...). For the fun of it and since I think it makes a nice interface I updated the...
  38. Replies
    11
    Views
    493

    Took defragsters idea and quickly hacked a GUI to...

    Took defragsters idea and quickly hacked a GUI to watch the library mallocing and freeing chunks of memory in a 56000 byte memory pool. (Win10 binaries and sources here:...
  39. Replies
    1
    Views
    119

    Couldn't you use a normal 3 pos 1 pol rotary...

    Couldn't you use a normal 3 pos 1 pol rotary switch, i.e., something like this https://www.digikey.de/product-detail/de/nkk-switches/MRB14B-A/360-3154-ND/4512287 ?
  40. Replies
    11
    Views
    493

    Good test, however you make it easy for the...

    Good test, however you make it easy for the library since you clean the memory every 100 iterations :-). For the fun of it I was thinking of doing a quick GUI showing a live memory map to watch...
  41. According to the datasheet the UE10PP is a 0.22A,...

    According to the datasheet the UE10PP is a 0.22A, 2.1mH stepper. Since you have a 256:1 gear on it you probably don't need a very good microstep performance. So, any of the omnipresent small stepper...
  42. Replies
    11
    Views
    493

    Good that it works with real EXTMEM as well :-) ...

    Good that it works with real EXTMEM as well :-)

    Here another example, showing how to use two heaps. One on DTCM and one on the external RAM:



    #include "static_malloc.h"

    smalloc_pool...
  43. Replies
    11
    Views
    493

    malloc/free for EXTMEM and DTCM

    This morning I stumbled over Andrey Rys static memory allocator library smalloc (https://github.com/electrorys/smalloc). This library provides malloc, calloc, free and a couple of other memory...
  44. Replies
    2
    Views
    210

    A couple of weeks ago I did IntervalTimerEx which...

    A couple of weeks ago I did IntervalTimerEx which is a very shallow wrapper around the stock IntervalTimer providing std::function<> callbacks. I.e., you can attach pretty much anything callable,...
  45. Replies
    5
    Views
    217

    The Arduino IDE automatically includes Arduino.h....

    The Arduino IDE automatically includes Arduino.h. The error message defragster posted, shows that Arduino.h includes WProgram.h which includes math.h...
  46. Replies
    5
    Views
    217

    y1 is already defined by the math library (y1 is...

    y1 is already defined by the math library (y1 is the name for a Bessel function). Therefore you can not declare a global variable with this name. It is the same as you would like to declare a global...
  47. Replies
    18
    Views
    461

    No problem at all. Let me know if you stumble...

    No problem at all. Let me know if you stumble over anything else or miss some functionality.
  48. Replies
    18
    Views
    461

    Just had a look at the pinout. Pin 16 doesn't...

    Just had a look at the pinout. Pin 16 doesn't have interrupt capability on the LC. 14, 15 have. So, this makes sense.
  49. Replies
    18
    Views
    461

    Can you post a picture / sketch which shows how...

    Can you post a picture / sketch which shows how you connected the encoders?
  50. Replies
    6
    Views
    238

    Here some links to collection of Teensy Eagle...

    Here some links to collection of Teensy Eagle libraries


    https://www.pjrc.com/teensy/eagle_lib.html
    https://github.com/TeensyUser/doc/wiki/ECAD
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4