hi everyone,im working on flood monitoring system.here my arduino code for receiving data serially..is it this code really work?
im receiving the latitude and longitude data from the transmitter as well as the water level data..is there any changes that i have to make in order to get the code work?sorry, im very new with arduino board...tq for ur help...
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
int rate;
void setup(){
Serial.begin(9600);
Mirf.spi = &MirfHardwareSpi;
Mirf.init();
Mirf.setRADDR((byte *)"serv1");
Mirf.payload = sizeof(rate);
Mirf.config();
}
void loop(){
while(!Mirf.dataReady()){
}
Mirf.getData((byte *) &rate);
Serial.println(rate);
delay(100);
}