程序如下:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
long t = 0;
void loop() {
// put your main code here, to run repeatedly:
if( Serial.available())
{ t = Serial.read();};
Serial.println(t);
delay(2000);
}
实际使用arduino的串口监视助手发送100 返回48