jlopez2022
Member
I am newbie on teensy and have not much idea in makefiles or json.
I have seen several libraries at gitub for the teensy board.
What is the way to upload it to the project?
I tried to copy the directory of the TeensyTimerTool library to D:\Arduino\hardware\teensy\avr\libraries and used the Visualteensy to generate the project, then the new library appeared named "TeensyTimerTool-master"
To test it I copied the example "UsingChronoDurations2.ino" to the main and appeared an error in the last line:
The error is:
The question is if the implementation of the library is correct and what is the right method to include a lib
I have seen several libraries at gitub for the teensy board.
What is the way to upload it to the project?
I tried to copy the directory of the TeensyTimerTool library to D:\Arduino\hardware\teensy\avr\libraries and used the Visualteensy to generate the project, then the new library appeared named "TeensyTimerTool-master"
To test it I copied the example "UsingChronoDurations2.ino" to the main and appeared an error in the last line:
Code:
void setup()
{
while (!Serial) {} // wait for PC to connect the virtual serial port
for (OneShotTimer& t : timer) // for the sake of simplicity, attach the same isr to all timers in array
{
t.begin(isr);
}
timer[0].trigger(10ms); // 10 ms
timer[1].trigger(0.5s + 10ms); // 510 ms
timer[2].trigger(2.5 * 0.3s + 20'000us / 2); // 760 ms
timer[3].trigger(milliseconds(50) + microseconds(5000)); // 55ms
t_0 = millis();
pt1.begin([]{digitalToggleFast(LED_BUILTIN)})
}
The error is:
Code:
> Executing task: D:/VisualTeensy_v0_9_9_2/make.exe all -j -Otarget <
USER [CPP] main.cpp
src/main.cpp: In lambda function:
src/main.cpp:29:48: error: expected ';' before '}' token
pt1.begin([]{digitalToggleFast(LED_BUILTIN)})
^
src/main.cpp: In function 'void setup()':
src/main.cpp:29:49: error: no matching function for call to 'TeensyTimerTool::PeriodicTimer::begin(setup()::<lambda()>)'
pt1.begin([]{digitalToggleFast(LED_BUILTIN)})
^
In file included from lib/TeensyTimerTool-master/src/timer.h:4:0,
from lib/TeensyTimerTool-master/src/TeensyTimerTool.h:4,
from src/main.cpp:2:
lib/TeensyTimerTool-master/src/baseTimer.h:57:15: note: candidate: template<class T> TeensyTimerTool::errorCode TeensyTimerTool::BaseTimer::begin(TeensyTimerTool::callback_t, T, bool)
errorCode BaseTimer::begin(callback_t callback, T p, bool start)
^
lib/TeensyTimerTool-master/src/baseTimer.h:57:15: note: template argument deduction/substitution failed:
src/main.cpp:29:49: note: candidate expects 3 arguments, 1 provided
pt1.begin([]{digitalToggleFast(LED_BUILTIN)})
^
make: *** [makefile:230: .vsteensy/build/src/main.o] Error 1
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command D:/VisualTeensy_v0_9_9_2/make.exe all -j -Otarget" terminated with exit code: 1.
The question is if the implementation of the library is correct and what is the right method to include a lib