I have been looking on in here >> http://www.hoperf.com/upload/rf/RFM70.pdf to utilise the Register Bank 1 to get the RSSI feed ? haven't seen any example to do the same.
Any examples? code snippets to do the same?
This is the working code:
#include "RFM70.h"
RFM70class RFM70;
byte RFM70_buf[MAX_PACKET_LEN]; //RFM70 data buffer
unsigned long RFMSendTime = 0; //next send time
int RFMSendSpeed=1000; //send packet every 1000 msec
void setup()
{
Serial.begin(57600);
Serial.println("Arduino Start");
RFM70.begin();
RFM70.Initialize();
RFMSendTime = millis();
}
void loop()
{
rfmTask(); //check for RFM70 event in polling mode
if (millis() > RFMSendTime) //send packet
{
RFMSendTime = millis() + RFMSendSpeed;
RFM70_buf[0]=0X41;
RFM70_buf[1]=0X42;
RFM70_buf[2]=0X43;
RFM70_buf[3]=0X44;
RFM70.Send_Packet(WR_TX_PLOAD,RFM70_buf,4);
Serial.println("Sending data");
}
}
void rfmTask() //RFM70 event handler
{
if (RFM70.RfmInterrupt())
{
if (RFM70.TxDataSentInterrupt())
{
Serial.println("Data sent OK");
RFM70.SwitchToRxMode();
}
if (RFM70.TxDataSentErrorInterrupt())
{
Serial.println("Data sent error");
RFM70.SwitchToRxMode();
}
if (RFM70.RxDataReadyInterrupt())
{
Serial.println("Data received: ");
byte rx_len = RFM70.Receive_Packet(RFM70_buf);
if (rx_len)
{
for(byte i=1;i<rx_len;i++)
{
Serial.print(i);
Serial.print("->");
Serial.println(RFM70_buf[i]);
}
}
}
}
}
what assertions should be there added in the code to make it read RSSI??