我是 c 编程的新手,正在尝试比较 IR HEX 字符串。我收到错误:左值需要作为赋值的左操作数。
我觉得我的问题在第 31 行左右。这是代码:
/* IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* http://arcfn.com
*/
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
String stringAppleUp;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
Serial.println ("See it");
stringAppleUp = string('77E150BC'); //apple remote up button
if ( ???? = stringAppleUp) {
Serial.println("yes");
}
else
{
Serial.println("No");
}
irrecv.resume(); // Receive the next value
}
}
这条线: if (??? = stringAppleUp) 我不知道应该把什么变量放在 ??? 是。
谢谢您的帮助。将要