简体   繁体   English

没有匹配的 function 调用 'LiquidCrystal::write(String&)'

[英]no matching function for call to 'LiquidCrystal::write(String&)'

void printOnLcd(String s){
  for (int i =0; i<2; i++){ 
    if( i % 2 == 0){ 
         for(int a=0; a<16; a++){ 
             lcd.setCursor(a,i);
             lcd.write(s);
             delay(200); 
             lcd.setCursor(a,i);
             lcd.write(" ");
         }
    } else {
       for(int a = 0; a<16; a++){
           lcd.setCursor(a,i);
           lcd.write(s);
           delay(200);
           lcd.setCursor(a,i);
           lcd.write(" ");
       }
    }
}

Arduino gives me the problem: no matching function for call to 'LiquidCrystal::write(String&)' Can't I put a string on the screen? Arduino 给了我一个问题:没有匹配的 function 调用 'LiquidCrystal::write(String&)' 我不能在屏幕上放一个字符串吗? what's the problem?有什么问题? I encountered this problem a few days ago and now I don't have a chance to look for a possible solution.几天前我遇到了这个问题,现在我没有机会寻找可能的解决方案。

now I don't have a chance to look for a possible solution.现在我没有机会寻找可能的解决方案。

Open a webbrowser, enter www.google.com , enter "Arduino LiquidCrystal", click the first hit:打开浏览器,输入www.google.com ,输入“Arduino LiquidCrystal”,点击第一个点击:

https://www.arduino.cc/en/Reference/LiquidCrystal < the Arduino manual btw. https://www.arduino.cc/en/Reference/LiquidCrystal < Arduino 手册顺便说一句。 Read it!阅读!

You're trying to use LiquidCrystal.write, so click write and read.您正在尝试使用 LiquidCrystal.write,因此请单击写入和读取。

Syntax句法

lcd.write(data) lcd.write(数据)

data: the character to write to the display数据:要写入显示器的字符

So obviously you can only use this function to print a single character.所以显然你只能使用这个 function 来打印单个字符。

Now check wether there is another function that allows you to write a string.现在检查是否还有另一个 function 允许您编写字符串。

The next function in the list is print列表中的下一个 function 是print

Sounds good, let's click that and read.听起来不错,让我们点击阅读。

Syntax句法

lcd.print(data) data: the data to print (char, byte, int, long, or string ) lcd.print(data) data:要打印的数据(char、byte、int、long 或string

Hey this allows us to display a string!嘿,这允许我们显示一个字符串!

Try it out lcd.print(s);试试lcd.print(s);

Alternatively click any of the many examples.或者单击许多示例中的任何一个。 Most of them use print.他们中的大多数使用打印。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:没有匹配函数来调用...(std :: string&) - error: no matching function for call to…(std::string&) 错误:没有匹配函数可调用&#39;isupper(std :: string&)&#39;| - error: no matching function for call to 'isupper(std::string&)'| 错误:没有用于调用“getline(FILE*&amp;, std::string&amp;)”的匹配函数 - error: no matching function for call to 'getline(FILE*&, std::string&)' 如果在子 class 中没有构造方法,则错误“没有匹配的 function 调用 'LGame::LGame(String&amp;)'” - Error “no matching function for call to 'LGame::LGame(String&)'” if in child class there is no constructor method 没有匹配的 function 调用 'std::vector::push_back(std::string&amp;)' - No matching function for call to ‘std::vector::push_back(std::string&)’ 字符串的排列-错误:没有匹配的函数来调用&#39;std :: set <char> :: insert(std :: string&)&#39; - Permutations of a string --error: no matching function for call to ‘std::set<char>::insert(std::string&)’ “没有匹配函数来调用'async(std :: launch,<unresolved overloaded function type>,std :: string&)'” - “no matching function for call to ‘async(std::launch, <unresolved overloaded function type>, std::string&)’” 为什么这个编译错误? - 没有匹配函数来调用&#39;std :: basic_ofstream <char> ::打开(的std :: string&)” - why this compiler error? - no matching function for call to 'std::basic_ofstream<char>::open(std::string&)' 为什么C ++中的getline()无法正常工作? (没有匹配函数可调用“ getline(std :: ofstream&,std :: string&)” - Why is getline() in C++ not working? (no matching function for call to 'getline(std::ofstream&, std::string&)' 没有匹配的函数调用 &#39;TiXmlElement::TiXmlElement(std::_cxx11::string&amp;) - no matching function for call to 'TiXmlElement::TiXmlElement(std::_cxx11::string&)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM