I did buy a arduino for school and I liked it. Now I would like to check if it is possible to controle a remote relay from my arduino. For testing the wireless connection I also bought the remote control.
I also have bought:
- NRF905 (nRF905 Radio Library for AVR and Arduino | Zak’s Electronics Blog ~*).
- BFT Mitto YET079 (http://uk.alibaba.com/product/485177154-wireless-rf-garage-door-remote-control.html)
- ZK2DC (This product is no longer available.) without the remote but the relay.
I did use the library from the NRF905 and have created the following code. I couple of days a go I did receive a activity on one of the channels but no they are not available anymore.
But can someone tell me how I can receive the click event of the remote control?
// Includes
#include <nRF905.h>
#include <SPI.h>
// Variable
int tChannel = 0;
// Setup
void setup()
{
// Start up
nRF905_init();
// Put into receive mode
nRF905_receive();
// Serial
Serial.begin(9600);
}
// Loop
void loop()
{
// Frequency instellen
nRF905_setChannel(NRF905_BAND_433, tChannel);
delay(20);
//NRF905_BAND_433
if(nRF905_airwayBusy())
{
Serial.print(tChannel);
Serial.print(": ");
Serial.print("Bussy");
Serial.print("\n");
byte tBuffer[NRF905_MAX_PAYLOAD];
if(nRF905_getData(tBuffer, sizeof(tBuffer)))
{
Serial.print(tChannel);
Serial.print(": ");
Serial.print("Data");
Serial.print("\n");
}
}
// Channel
if(tChannel == 511)
{
tChannel = 0;
}else
{
tChannel += 1;
}
}