新手入门
- 积分
- 15
- 金钱
- 15
- 注册时间
- 2020-11-11
- 在线时间
- 4 小时
|

楼主 |
发表于 2021-1-13 18:15:18
|
显示全部楼层
#define MD0 11
#define AUX 4
String comdata = "";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while(Serial.read()>= 0){} //clear serialbuffer
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(MD0, 0);
digitalWrite(AUX, 0);
if(Serial.available()>0){
delay(100);
comdata =Serial.readString();
Serial.print("Transmit the following information: ");
Serial.println(comdata);//comdata is the information that transmited
}
while(Serial.read()>= 0){}
} |
|