[问题]关于红外通讯中接收信号的问题!!

2018-12-3 22:02:37
2643
下面这段代码,红圈中的部分有问题:
捕获.PNG
如果将该代码烧到小车中,就会出现如下错误提示:
cluded from C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:223:0,
                 from project_he11_1.ino:1:
C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/WString.h:143:16: error:   initializing argument 1 of 'unsigned char String:perator==(const char*) const' [-fpermissive]
  unsigned char operator == (const char *cstr) const {return equals(cstr);}
                ^
project_he11_1.ino:88:20: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
In file included from C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:223:0,
                 from project_he11_1.ino:1:
C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/WString.h:143:16: error:   initializing argument 1 of 'unsigned char String:perator==(const char*) const' [-fpermissive]
  unsigned char operator == (const char *cstr) const {return equals(cstr);}
                ^
project_he11_1.ino:95:20: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
In file included from C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:223:0,
                 from project_he11_1.ino:1:
C:\Program Files (x86)\mBlock\Arduino\hardware\arduino\avr\cores\arduino/WString.h:143:16: error:   initializing argument 1 of 'unsigned char String:perator==(const char*) const' [-fpermissive]
  unsigned char operator == (const char *cstr) const {return equals(cstr);}
                ^
invalid conversion from 'int' to 'const char*' [-fpermissive]


其实就是图片中红圈内的数据类型无法进行强制转换,
如果采用 另.PNG 模块,则红外接收寄存器只能读取一次,无法进行3次判断,
请问各位大神,该怎么办??
收藏
3 条回帖
我就是我中级会员2018-12-4 15:30:18
将主体逻辑用图形化语句写出来,变量类型转换错误的话,直接修改图形化代码生成的 Arduino C 代码可行吧
renjieyouxi注册会员2018-12-6 08:56:08
问题已经解决,谢谢
需要登陆后才可进行回复 登录

返回顶部
现在加入我们,注册一个账号 账号登陆 QQ账号登陆 微博账号登陆