void loop()
{
char buf[100];
int iLen = wifi.ReceiveMessage(buf);
if(iLen > 0)
{
//mini Rboard D4 pin is relay,mini Rboard URL:http://item.taobao.com/item.htm? ... keTJ&id=39334222369
if (strcmp(buf, "CH0ON") == 0)
{
digitalWrite(4,HIGH);
DebugSerial.println("CH0ON");
}
if (strcmp(buf, "CH0OFF") == 0)
{
digitalWrite(4,LOW);
DebugSerial.println("CH0OFF");
}
/* the other 3 chanels below are for Rboard D5 D6 D7 , Rboard URL:http://item.taobao.com/item.htm? ... keTJ&id=39334222369
if (strcmp(buf, "CH1ON") == 0)
{
digitalWrite(5,HIGH);
DebugSerial.println("CH1ON");
}
if (strcmp(buf, "CH1OFF") == 0)
{
digitalWrite(5,LOW);
DebugSerial.println("CH1OFF");
}
if (strcmp(buf, "CH2ON") == 0)
{
digitalWrite(6,HIGH);
DebugSerial.println("CH2ON");
}
if (strcmp(buf, "CH2OFF") == 0)
{
digitalWrite(6,LOW);
DebugSerial.println("CH2OFF");
}
if (strcmp(buf, "CH3ON") == 0)
{
digitalWrite(7,HIGH);
DebugSerial.println("CH3ON");
}
if (strcmp(buf, "CH3OFF") == 0)
{
digitalWrite(7,LOW);
DebugSerial.println("CH3OFF");
}
*/
}
}
|