[英]Error: No instance of overloaded function “mbed::Ticker::attach” matches the argument list
I set up the ticker here: 我在这里设置股票行情:
Ticker readSample;
uint16_t* sample() {
samples[sCount]=sensor.read_u16();
sCount++;
if(sCount == 159) {
sCount = 0;
}
return samples;
}
And called it in main function here: 并在这里的主要功能中调用它:
int main() {
readSample.attach(&sample, 0.0125);
I get error code 304, no idea how to overcome this. 我收到错误代码304,不知道如何克服这个问题。 Cant find a straight answer that's transferrable to my work. 不能找到直接的答案,可以直接转移到我的工作中。
Error: No instance of overloaded function "mbed::Ticker::attach" matches the argument list in "main.cpp", Line: 142, Col: 17 错误:没有重载函数“ mbed :: Ticker :: attach”的实例与“ main.cpp”中的参数列表匹配,行:142,列:17
First time poster, total amateur at coding, any and all help/advice is massively appreciated. 第一次张贴海报,编码方面的业余爱好者,非常感谢任何帮助/建议。
The return type of an attached function has to be void. 附加函数的返回类型必须为空。 You cannot return uint16_t*. 您不能返回uint16_t *。 Here is the function declaration. 这是函数声明。
attach (Callback< void()> func, float t)
You can learn more about Ticker class here. 您可以在此处了解有关股票行情的更多信息。 https://os.mbed.com/docs/mbed-os/v5.11/apis/ticker.html https://os.mbed.com/docs/mbed-os/v5.11/apis/ticker.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.