hi guys
Im currently trying to use a nRF905 transceiver and the nRF905 Radio Library for Arduino (4.0) to transmit some bits (as per below) on the 433mhz frequency but Im having a hard time understanding the code, Ive never done something like this before and arduino language is still quite new to me.
I'm currently trying to use this code (also is below) as my reference but i don’t understand a-lot of it (such as BUF_LEN, CONF_LEN, i know what TX is but i don’t know what the address is and quite a lot of other stuff), if someone could please explain what these mean and maybe write out a bit of example code that explains everything that would be helpful. Thanks
bits I'm trying to transmit:
0000000010000001100000101000001110000100100001011000011010000111100010001001100010101000101110001100100011011000111010001111100100101001001110010101100101101001011110011001101010011011100111011001111010011111101010101110101101101011111011011110111011111111
Reference code Im using:
#include <NRF905.h>
#include <SPI.h>
#define BUF_LEN 32
#define CONF_LEN 10
#define NRF905_CSN 10
unsigned char tx_buf[BUF_LEN]= "RDIoT TX CNT: \r\n";
unsigned char read_config_buf[CONF_LEN];
byte tx_address[4]= {0xcc,0xcc,0xcc,0xcc};
void setup()
{
unsigned char i;
pinMode(NRF905_CSN,OUTPUT); //to make sure SPI works
nrf905=NRF905(NRF905_CSN);
nrf905.init();
/**
default configuration, need to specify frequency
choose Z-Wave frequency band, support :
US 908.42Mhz
EUROPE 868.42MHz
AFRICA 868.42MHz
CHINA 868.42MHz
HK 919.82MHz
JAPAN 853.42MHz
AUSTRALIA 921.42MHz
NEW_ZEALAND 921.42MHz
BRASIL 921.42MHz
RUSSIA 896MHz
*/
nrf905.write_config(US);
nrf905.read_config(read_config_buf);
Serial.begin(9600);
for(i=0; i<10; i++)
{
Serial.print(read_config_buf[i],HEX);
Serial.print(' ');
}
tx_buf[12] = '0';
}
void loop()
{
/** transmit data packet with default TX Address */
nrf905.TX(tx_buf);
/** transmit data packet with specified TX Address */
// nrf905.TX(tx_buf, tx_address);
// NOTE: TX_Address and RX_Address must be the same
/** Count Sending times */
tx_buf[12]++;
if(tx_buf[12] == 0x3A){
tx_buf[12] = '0';
}
delay(50);
}