its the difference between a char array string and a String object, to convert the String object use tochararray() linky
to send a float you could create a structure containing a float type and pass the address of the structure to the send function.. saves manipulating the value into a char arrayon the way in and back to a float for math on the way out on the receiving side
nrf24.send(&myFloatStruc,sizeof(myFloatStruc));
if you really want to use Strings you could encapsulate one in a structure also
tho Strings and the support lib is FAT and wasteful, most would advice you drop it..
nrf24_client.ino: In function 'void loop()':
nrf24_client:71: error: no matching function for call to 'RH_NRF24::send(DATA*, unsigned int)'
C:\Program Files (x86)\Arduino\libraries\RadioHead/RH_NRF24.h:512: note: candidates are: virtual bool RH_NRF24::send(const uint8_t*, uint8_t)
works slightly differently, you create a header structure which contains the address of the receiving node and the type of message (default 0) and a payload structure to contain the message
your error message indicates the send wants a pointer to an int and a size?
RH_NRF24::send(const uint8_t*, uint8_t)
Simplest possible example of using RF24Network. Put this sketch on one node, and helloworld_rx.pde on the other. Tx will send Rx a nice message every 2 seconds which rx will print out for us.
/*
Copyright (C) 2012 James Coliz, Jr. <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
Update 2014 - TMRh20
*/
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
RF24 radio(9,10); // nRF24L01(+) radio attached using Getting Started board
RF24Network network(radio); // Network uses that radio
const uint16_t this_node = 1; // Address of our node
const uint16_t other_node = 0; // Address of the other node
const unsigned long interval = 2000; //ms // How often to send 'hello world to the other unit
unsigned long last_sent; // When did we last send?
unsigned long packets_sent; // How many have we sent already
struct payload_t { // Structure of our payload
unsigned long ms;
unsigned long counter;
};
void setup(void)
{
Serial.begin(57600);
Serial.println("RF24Network/examples/helloworld_tx/");
SPI.begin();
radio.begin();
network.begin(/*channel*/ 90, /*node address*/ this_node);
}
void loop() {
network.update(); // Check the network regularly
unsigned long now = millis(); // If it's time to send a message, send it!
if ( now - last_sent >= interval )
{
last_sent = now;
Serial.print("Sending...");
payload_t payload = { millis(), packets_sent++ };
RF24NetworkHeader header(/*to node*/ other_node);
bool ok = network.write(header,&payload,sizeof(payload));
if (ok)
Serial.println("ok.");
else
Serial.println("failed.");
}
}