i ordered RFbee to use it without serially connected host MCU.
so ATmega168 on Rfbee does not only control the wireless module but also give command to the device connected.
If you want to control LED connected to the remote RFBee, then you need to do send the protocol data defined by yourself to the remote RFBee. And you need to add some code to the firmware on remote RFBee to parse the data, and then do corresponding control on the LED.
We are planning to add this function in firmware version v2.0, though v1.1 is about to release
May this helpful to you, and please feel free to ask any question.
hi icing thanks for the reply.
what i meant for was conrolling LED remotley from the other RFbee.
would it be possible to have the code? or should i wait for version 2.?
i’m using RFbee V1.1 and Arduino 18.
i understand pretty much codes in the arduino site but the RFbee firmware is too hard for me.
the final goal is to eliminate host MCU in my project to minimize the cost and size.
analogRead(0) from RFbee1 --------- Rfbee2 led intensity
would be nicer exmaple for me but once blink led got working then i may find my way to do it.
could you recommend me ISP programmer which has proper spacing fitting into RFbee?
I have used the adafruit xbee board and a standard ftdi programming cable to talk to one. I kinda like the little board they have, it does level conversion and power regulation, and not much else.
Icing can correct me, but I believe there is a 6pin icsp (not populated) that a standard atmel programmer could be used with. I have used both the adafruit and the Usb uart from seeed to program the 168.
The board needs pwr, gnd, and the pins come out. It will be 3.3 volts unless you use a level converter.
The standard arduino tools work with it, select nano 8mhz 168 and it works fine with either setup.
the RFBee is basically an Arduino with a radio, so you can run any sketch you would run on an arduino on an RFBee.
The tricky part is to use the radio, however it is not so hard as you might think.
To be able to program the RFBee you need to have a way to connect your PC/Laptop to the RFbee.
Easiest solution is of course a UartSB board or a Xbee shield, however if you already have an Arduino/Seeeduino you can use that too.
(its a special trick, but it is possible )
Once you have the serial connection with the RFBee it is possible to program it and build your setup.
Like any other arduino sketch the code runs in the “loop()” function.
In your case you will want the main loop of the sender to read the analog value and then transmit the value using the transmitData() function. The receiving RFBee will only use receiveData
so on the sending RFBee something like:
void loop()
{
int val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
message[1]= (byte) val & 0x00FF;
message[0]= (byte) val >> 8;
transmitData(message,2,0,0);
}
if ( digitalRead(GDO0) == HIGH ) { // we have received data
result=receiveData(rxData, &len, &srcAddress, &destAddress, &rssi , &lqi);
if ((result == OK) && (len==2)){
int val=rxdata[0]<< 8 | rxdata[1];
// and there is your value again which you can use to control the led…
analogWrite(analogPin, val);
}
}
In theory it can do it by configurating the registers. But the RF front circuit is designed for 868M - 915M frequency. So the quality of the RF signal will not good if it works in 433M.
does someone make this code work for the receiver rfbee?
void loop()
{
byte rxData[CCx_PACKT_LEN];
byte len;
byte srcAddress;
byte destAddress;
byte rssi;
byte lqi;
int result;
if ( digitalRead(GDO0) == HIGH ) { // we have received data
result=receiveData(rxData, &len, &srcAddress, &destAddress, &rssi , &lqi);
if ((result == OK) && (len==2)){
int val=rxdata[0]<< 8 | rxdata[1];
// and there is your value again which you can use to control the led..
analogWrite(analogPin, val);
}
}
Whatever I do, arduino tells me rxdata is not declared in this scope- I’m pretty confused.