i am using two arduino boards with cc1101 transceiver .i am trying to use one as transmitter and the other as receiver but when i try to read any register it gives me value 0 .what does this mean . i am using the ELECHOUSE cpp file and header files .is there any error in these files.the header and cpp file i am attaching below.the TX and RX code is given below.
transmitter code;
#include <ELECHOUSE_CC1101.h>
#define size 61
byte TX_buffer[size]={
0};
byte i,s;
void setup()
{
Serial.begin(9600);
ELECHOUSE_cc1101.Init();
for(i=0;i<size;i++)
{
TX_buffer[i]=i;
}
}
void loop()
{
s=ELECHOUSE_cc1101.SpiReadReg(CC1101_FREQ0)
Serial.Println(s)
ELECHOUSE_cc1101.SendData(TX_buffer,size);
delay(1);
}
RX
#include <ELECHOUSE_CC1101.h>
void setup()
{
Serial.begin(9600);
ELECHOUSE_cc1101.Init();
ELECHOUSE_cc1101.SetReceive();
}
byte RX_buffer[61]={0};
byte size,i,j,flag;
void loop()
{
if(ELECHOUSE_cc1101.CheckReceiveFlag())
{
size=ELECHOUSE_cc1101.ReceiveData(RX_buffer);
for(i=0;i<size;i++)
{
//Serial.print(RX_buffer[i],DEC);
Serial.write(RX_buffer[i]);
for(j=0;j<size;j++)
{
Serial.Println(RX_buffer[j]);
}
//Serial.print('',BYTE);
Serial.write(' ');
}
Serial.println(" ok");
ELECHOUSE_cc1101.SetReceive();
}
}