You've declared dataIn as a character. It will never be equal to a string. P1LED and P2LED are declared as integers. They will also never be equal to a string.
I have done a fair bit of VBA coding but this "C+" is all very new to me
I try to work logically but as proven it doesn't always work out the way I expect
It is strict in syntax/semantics and NOT on formatting. For exampe:
String myData1;
in the above here myData1 is an object (variable) of type String which is a "user data type". You can apply method/function on myData1. For example:
String myData1 = "Forum";
char y = myData1.charAt(3); //the method carAt() is applied on myData1
Serial.println(y); //shows: u
char myData2[] = "Forum";
In the above myData2 is an array whose elements are of type char. For example:
@Glen_Lewis, please keep related questions on one thread. The first provides good background for the second. Both questions are about "serial communications".
void loop() {
if(Serial.available()){
char c = Serial.read();
Serial.print(c);
if ('7' == c)
digitalWrite(8,HIGH);
else if ('6' == c)
digitalWrite(8,LOW);
}
}
Thanks for this
Is this code limited to 4 items? (A,B,234,567)
I have tried adding 2 more fields to both parts of the code (UNO1 and UNO2) (A,B,C,D,234,567)
I am getting funny readings on the 2nd serial monitor
Like A
B
C
-22
234 ...