Hi, everyone! I just making a Arduino<->C# app but I can't figure out how can I escape from this error:
void setup() {Serial.begin(9600);}
void loop() {
if(Serial.available())
{
char a = Serial.read();
if(a.indexOf("Hour:") > 0) { // err: request for member 'indexOf' in 'a', which is of non-class type 'char'
String lastHour = a.substring(6); // err: request for member 'substring' in 'a', which is of non-class type 'char'
int hour = lastHour.toInt();
}
}
}
The program makes 2 errors: First one is in the if(a.index ... section. The error says "request for member 'indexOf' in 'a', which is of non-class type 'char'" but I can't figure out how can I solve this error. Same for String lastHour ...
Can anyone help ? Thanks.