|
- void loop() {
while(client.available()){
String line = client.readStringUntil('\r');这个看不懂什么意思。
//valueread=line[47];
//Serial.println(valueread);
if(line[5]=='3' & line[8]=='0' & line[9]=='1')这个line数组中的字符是服务器传来的字符串,那最开始字符储存在哪?
{
digitalWrite(relay1,HIGH);
Serial.println("led on");
}
- if(line[5]=='3' & line[8]=='0' & line[9]=='0')这个line数组变量是从哪个函数获得字符的?
{
digitalWrite(relay1,LOW);
Serial.println("led off");
}
}
- 是第二个代码
- if (data[0] == '1') {
- GPIO_OUTPUT_SET(GPIO_ID_PIN(15), 0);
- MQTT_Publish(client, "/xuhong/LED/out", "LED status is open ...", 这个data数组变量是从哪个函数获得字符的?
- 和上个程序有区别吗?
- strlen("LED status is open ..."), 0, 0);
- }
if (data[0] == '0'){ GPIO_OUTPUT_SET(GPIO_ID_PIN(15), 1); MQTT_Publish(client, "/xuhong/LED/out", "LED status is off ...", strlen("LED status is off ..."), 0, 0); }
|
|