luni
Reaction score
21

Latest activity Postings About

    • luni
      luni replied to the thread TeensyTimerTool.
      This https://github.com/manitou48/teensy4 is always a good starting point if you need to do some low level programming. It contains some examples for input capture using the GPT module
    • luni
      luni replied to the thread TeensyTimerTool.
      Great, I'll do some testing these days and generate a new release for the library manager afterwards.
    • luni
      luni replied to the thread TeensyTimerTool.
      Sorry, didn't mention that the library lives on GitHub. https://github.com/luni64/TeensyTimerTool, And here an instructiion on how to install if from there: https://roboticsbackend.com/install-arduino-library-from-github/ I'll update the...
    • luni
      luni replied to the thread How do you organize large sketches?.
      Actually you can by using anonymous namespaces. Here an example: test.h #pragma once namespace someNamespace { extern int getVar(); extern int publicVar; } test.cpp namespace someNamespace { namespace // anonymous/private namespace...
    • luni
      luni replied to the thread TeensyTimerTool.
      @joepasquariello. Yes this is a lambda expression. Here some explanation about the origin of the name: https://www.baeldung.com/cs/lambda-functions . Actually the c++ syntax for lambdas is quite simple and logical. Here the full (AFAIK) syntax...
    • luni
      luni replied to the thread TeensyTimerTool.
      Sorry, that was a bug. Can you try version 1.4.3? The following code correctly generates 500kHz signals on pin 0 and 1 using the PIT and GPT1 modules. It works for 24Mhz and 150MHz clock frequency settings. #include "TeensyTimerTool.h" using...
    • luni
      ... or, if you don't like std::function / std::bind you can simply use a lambda: void timeit(void(*f)()) { elapsedMillis time; f(); printf("took %d\n", (unsigned)time); } void g1(){ delay(120); } void g2(int x){ delay(x); }...
    • luni
      You can also use std::function and std::bind to achieve this without macros: #include <functional> void timeit(std::function<void()> f) { elapsedMillis time; f(); printf("took %d\n", (unsigned)time); } void g1(){ delay(120); }...
    • luni
      luni replied to the thread New Stepper Motor Library.
      Thanks for spotting this. I'll have a look whats going on there. Might take a couple of days.
    • luni
      Changing the c-library would obviously require a lot of testing. And I still believe that Paul had a good reason for using newlib in the first place. So I don't think this will happen soon (if ever). IMOH, the workaround suggested by @jmarsh...
    • luni
      Hi @luni I switched to newlib-nano and enabled _printf_float and _scanf_float. The difference is enormous Before: teensy_size: Memory Usage on Teensy 4.1: teensy_size: FLASH: code:419516, data:281120, headers:8992 free for files:7416836...
    • luni
      There probably are good reasons to use newlib instead of newlib-nano by default. I'm just wondering because ARM developped it for use in embedded processors as opposed to newlib which is meant for linux. The missing float printf / scanf can be...
    • luni
      luni replied to the thread Compilation fails.
      Seems to be the same issue as discussed here: https://forum.pjrc.com/index.php?threads/compile-once-warning-s-compile-again-no-warnings.74822/post-341746
    • luni
      @shawn: the "smallest-code" option uses the nano version of newlib which is optimized for embedded systems. You can switch to it using the compiler switch --specs = nano.specs. Looks like newlib-nano doesn't have the exception stuff compied in...
    • luni
      Even though the c++ compiler is passed switches like "-fnoexceptions -fno-rtti -fno-threadsafe-statics", the copy of libstdc++ that gets linked by Teensyduino was still built with exceptions enabled and includes a bunch of cruft associated with...
    • luni
      Since you are doing a c# application you might be interested in TeensySharp. https://github.com/luni64/TeensySharp Getting a list of currently connected Teensies is a simple as this: var Watcher = new TeensyWatcher(); foreach (var Teensy in...
    • luni
      Simplest would be to connect the PWM pin to another pin and attach the interrupt to this.
  • Loading…
  • Loading…
Back
Top