arduino报错no matching function for call to 'Kalman::getAngle(int&, int&)' 原因
时间: 2024-05-29 22:12:12 浏览: 14
这个错误通常是因为在调用Kalman类的getAngle函数时,参数类型不匹配导致的。
请检查调用getAngle函数的地方,确保传递给它的参数类型与函数定义中的参数类型匹配。如果需要,请将参数转换为正确的类型。
另外,如果您使用的是自定义的Kalman类,可能需要检查getAngle函数是否正确实现和声明。如果需要,请修改函数定义以匹配参数类型。
最后,确保您的代码中包含Kalman类的正确头文件。如果没有包含正确的头文件,编译器无法识别Kalman类和其成员函数,从而导致错误。
相关问题
arduino中出现no matching function for call to Ticker::Ticker(void (\\&)(), int)
该错误通常表示您正在调用Ticker构造函数时未传递所需的参数。Ticker构造函数需要一个函数指针作为参数来指定要调用的函数。请确保您已正确传递函数指针并使用正确的函数签名。
例如,如果您要调用名为myFunction的函数,则可以使用以下代码:
```
Ticker myTicker(myFunction, 1000);
```
其中,第一个参数是函数指针,第二个参数是定时器的间隔时间(以毫秒为单位)。
请注意,函数签名必须与Ticker类所期望的相匹配。如果myFunction需要参数,则必须将其定义为void myFunction()。如果myFunction需要参数,则可以使用lambda表达式来传递它们。
如果您仍然无法解决问题,请提供更多代码和上下文,以便我们可以更好地帮助您。
arduino中no matching function for call to 'Ticker::Ticker(void (&)(), int)'
It seems like you are trying to create a Ticker object without specifying a function to call. The Ticker library in Arduino requires you to provide a function to call at a specific interval.
Here's an example of how to create a Ticker object that calls a function every 1000 milliseconds:
```
#include <Ticker.h>
void myFunction() {
// do something
}
Ticker myTicker(myFunction, 1000); // create a Ticker object that calls myFunction every 1000 milliseconds
```
Make sure you have included the Ticker library at the beginning of your sketch:
```
#include <Ticker.h>
```
Also, make sure that your function matches the Ticker library's function signature:
```
void myFunction() {
// do something
}
```
It should not have any parameters and return void.