Hi,
I want to make a network, in this network the information will be sent from clinets to server. I’m using Mirf lab. and I already read these websites ;http://arduino-info.wikispaces.com/nRF24L01-Mirf-Examples,http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01 and http://www.electrodragon.com/w/index.php?title=NRF24l01
But the problem is “Serial.print(data*, DEC);” printed on server serial monitor like 255255255255255255…[/u]
what is the way to get data like "clinet 1"
Thanks for help
here the clinet side (Beginning)
[u]```[/u]
[u]#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
void setup(){
Serial.begin(9600);
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
Mirf.setTADDR((byte *)“serv1”);
Mirf.payload = 32;
Mirf.config();
Serial.println("Beginning … ");
}
void loop(){
Mirf.send((byte ) “client 1”); // Mirf.send((byte ) “client 2”); Mirf.send((byte ) “client 3”); Mirf.send((byte ) “client 4”);
delay(1000);
}[/u]
[u]*[/u] [u]*the server side (Listening)*[/u] [u]*
[/u]
[u]#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
void setup(){
Serial.begin(9600);
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
Mirf.setTADDR((byte *)“serv1”);
Mirf.payload = 32;
Mirf.config();
Serial.println("Listening … ");
}
void loop(){
byte data[32];
if(!Mirf.isSending() && Mirf.dataReady()){
Serial.println(“Got packet”);
Mirf.getData(data);
int i;
for (i = 0; i < sizeof(data); i++)
{
Serial.print(data[i], DEC);
}
}
delay(1000);
}[/u]
[u]```*[/u]