关于在arduino

时间:2016-05-11 00:28:16

标签: c++ arduino

我在声明字符串时遇到问题。

  

Arduino:1.6.9(Windows 10),Board:" Arduino / Genuino Uno"

     

readBinaryCode:3:错误:' string'没有命名类型

string code = "10101010010010100101000101010101111100"
     

C:\用户\ Jerel \桌面\所有\ Sketchs \ readBinaryCode \ readBinaryCode.ino:   在函数' void loop()':

     

readBinaryCode:12:错误:'代码'未在此范围内声明

for(int i = 0; i < code.length(); i++) {...
     

退出状态1

     

&#39;串&#39;没有命名类型

此报告将提供更多信息 &#34;在编译期间显示详细输出&#34; 文件中启用了选项 - &gt;偏好。

1 个答案:

答案 0 :(得分:0)

它告诉你实话。

 'string' does not name a type

而不是

 `string code` use  `String code`



 void setup() {
      // put your setup code here, to run once:
    String code = "10101010010010100101000101010101111100";

    }

<强>更新 我们不需要为此包含任何内容