Data Sheet
9/24/2015 GroveSerialRFProWiki
http://www.seeedstudio.com/wiki/index.php?title=Twig__Serial_RF_Pro_v0.9b 4/6
SoftSerial.begin(9600);//theSoftSerialbaudrate
Serial.begin(9600);//theSerialportofArduinobaudrate.
}
voidloop()
{
delay(1000);
SoftSerial.write(0xAA);
SoftSerial.write(0xFA);
SoftSerial.write(0xE1);
if(SoftSerial.available())//ifdateiscomingfromsoftwareserialport==>dataiscomingfromSoftSerialshield
{
while(SoftSerial.available())//readingdataintochararray
{
buffer[count++]=SoftSerial.read();//writingdataintoarray
if(count==64)break;
}
for(inti=0;i<count;i++){
Serial.print(buffer[i],HEX);//ifnodatatransmissionends,writebuffertohardwareserialport
}
clearBufferArray();//callclearBufferArrayfunctiontoclearthestoreddatafromthearray
count=0;//setcounterofwhilelooptozero
}
if(Serial.available())//ifdataisavailableonhardwareserialport==>dataiscomingfromPCornotebook
SoftSerial.write(Serial.read());//writeittotheSoftSerialshield
Serial.println("...");
}
voidclearBufferArray()//functiontoclearbufferarray
{
for(inti=0;i<count;i++)
{buffer[i]=NULL;}//clearallindexofarraywithcommandNULL
}
Youcanseeasshowbelowafteropenserialmonitor.
Reference
ThefollowingtableliststhecommandsandresponsesinvolvedininteractingwithSerialRFProv0.9b.