Dear colleges,
Thanks a lot. There are very useful material here. But I have some problems:
this is my code:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() >0){
int val = Serial.read()- '0';
Serial.println(val);
}
}
and this is result:
when I print in SerialPort: 1
SerialPort write:
1
-35
-38
when I print in SerialPort: 2
SerialPort write:
2
-35
-38
Why it's heppen?
The -35 and -38 are negative acknowledge and device control 2 respectively.
But I want print only my variable, like you in your code.