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. 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...
  2. Replies
    6
    Views
    153

    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...
  3. Replies
    6
    Views
    153

    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...
  4. Replies
    6
    Views
    153

    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...
  5. Replies
    8
    Views
    279

    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 ...
  6. Replies
    8
    Views
    279

    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 ...
  7. Thread: TeensyTimerTool

    by luni
    Replies
    220
    Views
    10,650

    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...
  8. Replies
    22
    Views
    425

    It's slots

    It's slots
  9. Replies
    22
    Views
    425

    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...
  10. Replies
    22
    Views
    425

    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...
  11. Replies
    22
    Views
    425

    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 :-)
  12. Replies
    22
    Views
    425

    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...
  13. Replies
    22
    Views
    425

    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...
  14. Replies
    22
    Views
    425

    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...
  15. Replies
    5
    Views
    311

    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...
  16. Replies
    22
    Views
    425

    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...
  17. Replies
    22
    Views
    425

    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...
  18. 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...
  19. Replies
    210
    Views
    17,670

    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

    ...
  20. Thread: TeensyTimerTool

    by luni
    Replies
    220
    Views
    10,650

    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...
  21. Replies
    11
    Views
    407

    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:...
  22. Replies
    1
    Views
    118

    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 ?
  23. Replies
    11
    Views
    407

    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...
  24. 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...
  25. Replies
    11
    Views
    407

    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...
  26. Replies
    11
    Views
    407

    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...
  27. Replies
    2
    Views
    190

    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,...
  28. Replies
    5
    Views
    205

    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...
  29. Replies
    5
    Views
    205

    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...
  30. Replies
    18
    Views
    443

    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.
  31. Replies
    18
    Views
    443

    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.
  32. Replies
    18
    Views
    443

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

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

    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
  34. This has nothing to do with the eeprom. Float can...

    This has nothing to do with the eeprom. Float can only store about 6 significant digits. Try double if you really need more
    Digits.
  35. Replies
    18
    Views
    443

    The error you now get is due to an old version of...

    The error you now get is due to an old version of Bounce2 which is required to debounce the pushbutton. Unfortunately the one which comes with Teensyduino is a bit outdated.
    Since you are not the...
  36. All primitive types, i.e. float, double, char int...

    All primitive types, i.e. float, double, char int etc. and arrays or structures composed of primitive types and a lot more can be copied bytewise and are suitable for get/put. The code in the linked...
  37. As a remark I want to point out that get/put only...

    As a remark I want to point out that get/put only work if your variables can be copied trivially (i.e., bytewise). If you use more complicated objects like e.g. String the get/put code will silently...
  38. Sounds reasonable in principle but I would try to...

    Sounds reasonable in principle but I would try to keep the time with disabled interrupts small.

    Gui changes anything -> copy changes to the 'second' set -> disable timer interrupt -> swap...
  39. Replies
    5
    Views
    346

    Actually I'm working on it but it will take some...

    Actually I'm working on it but it will take some time (it currently is not on my priority list). Meanwhile here is some information about a workaround (never tested it)
  40. Replies
    8
    Views
    818

    Glad you like it and thanks for spotting this. I...

    Glad you like it and thanks for spotting this. I updated the repository with the fix.
  41. Replies
    18
    Views
    443

    @fdaniels: Can you give v2.2.1 a try? ...

    @fdaniels: Can you give v2.2.1 a try? https://github.com/luni64/EncoderTool/releases

    New features:

    Compatibility to T-LC
    Reduced memory footprint

    Bugfixes:

    Selecting plain vanilla...
  42. Not necessarily. You could use an IntervalTimer...

    Not necessarily. You could use an IntervalTimer to periodically call your midi handler. Just set the priority to 255 (lowest). It will still interrupt your display code but can be interrupted by any...
  43. Thread: Encoder Tester

    by luni
    Replies
    13
    Views
    1,861

    As per user request I exchanged the IntervalTimer...

    As per user request I exchanged the IntervalTimer by IntervalTimerEx and encapsulated it in the simulator class. It is now possible to generate up to four independent simulator objects. (v2.3.0)...
  44. Replies
    18
    Views
    443

    I just saw that I already prepared a new release...

    I just saw that I already prepared a new release a couple of weeks ago...just released it. You can try if v2.1.0 fixes the issue
  45. Replies
    18
    Views
    443

    Ok, I see what's wrong and it is probably already...

    Ok, I see what's wrong and it is probably already fixed in the current code. If you used the current release (v2.0) can you please replace it by the current version from master and give that a try?
  46. Replies
    18
    Views
    443

    Sure, I'm currently traveling but I can have a...

    Sure, I'm currently traveling but I can have a look later this week. I'm not aware of anything not compatible to T-LC. Which error message did you get?
  47. This might help ...

    This might help https://forum.pjrc.com/threads/47783-Teensy-programs-Teensy code is attached to the linked thread
  48. Replies
    5
    Views
    544

    The voltage drop will depend on the drive...

    The voltage drop will depend on the drive strength setting for the pin. Here some more information: https://electronics.stackexchange.com/questions/506354/teensy-4-x-imxrt1062-max-output-current
    ...
  49. Replies
    23
    Views
    7,334

    No no, this is how it would work: void...

    No no, this is how it would work:



    void myCallback(int position, int delta)
    {
    Serial.printf("pos:%d delta:%d\n", position, delta);
    }

    //....
  50. Replies
    499
    Views
    301,776

    Did you try ResponsiveAnalogRead?...

    Did you try ResponsiveAnalogRead? (https://github.com/dxinteractive/ResponsiveAnalogRead) This library is fantastic in getting stable reads from pots and similar slow devices.
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4