简体   繁体   English

错误:没有重载函数“ mbed :: Ticker :: attach”的实例与参数列表匹配

[英]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.

相关问题 没有重载函数“”的实例与参数列表错误匹配 - no instance of overloaded function “” matches the argument list error “没有重载函数“转换”的实例与参数列表匹配”并行执行时出错 - "no instance of overloaded function "transform" matches the argument list" error with parallel execution 错误没有重载的实例 function “getline” 与参数列表匹配 - Error No instance of overloaded function “getline” matches the argument list KEIL错误:没有重载函数“ std :: transform”的实例与参数列表匹配 - KEIL error: no instance of overloaded function “std::transform” matches the argument list 错误:多个重载函数实例与参数列表匹配 - Error: more than one instance of overloaded function matches argument list 错误没有重载函数的实例“getline”匹配参数列表c ++ - error no instance of overloaded function “getline” matches the argument list c++ 错误:多个重载函数实例与参数列表匹配 - Error: More than one instance of overloaded function matches the argument list 没有重载函数“搜索”的实例与参数列表匹配 - no instance of overloaded function “search” matches the argument list 没有重载函数“stoi”的实例与参数列表匹配 - no instance of overloaded function "stoi" matches the argument list 没有重载 function AddSnapshotListener 的实例与参数列表匹配 - no instance of overloaded function AddSnapshotListener matches the argument list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM