RFM69HCW send numbers

arduino pro mini 5v
RFM69HCW adafruit 5v tolerant

radio works good, so how would I send numbers. I want to read whatever is in gpio(A0) and send it.

the thing is set up to send words in "" quotes, how to change that. is it sprintf or char String = something????

Do not cross-post. Other thread removed.

You haven't specified which library you want to use. But, the typical method is to put data in a struct and send it all at once in a single packet.

Post the code, using code tags.

I use the LowPowerLab library. Have a look at their github page at all the examples. The Struct_send and Struct_receive examples may do what you want, or at least get you started.

using radiohead tx and rx raw examples

working on getting a definition and example of 'struct'.
been trying something i got working in a 433mhz ASK receiver

String str_out;
int dBv = 0;
str_out = String((char*)buf);
Serial.print("dBv ");
Serial.println(str_out);

I prefer RadioHead's Reliable Datagram construct.

this is the xmit method or struct that they give you

  char radiopacket[20] = "Hello World #";*emphasized text*

I'm trying stuff like the following

    // Compose output character
    //dBv = analogRead(A0);
    //str_out = String(dBv);
    //static char *msg = str_out.c_str();
    //char radiopacket[20] = *msg; 

ok tnx, i'll get this github a look see

deal directly with the buffer (buf) ??? hmmm yes, still need to get acquainted with syntax

No, you are not. Those are comments.

Post the actual code. ALL of it, using code tags.

github confuses the heck outa me i'm afraid
i have downloaded arduino downloaded library zips
but like the example on the top of you post, i can't see the whole example, i'll work at it
tnx

#include <SPI.h>
#include <RH_RF69.h>

#define RF69_FREQ 915.0

#if defined (__AVR_ATmega328P__)  // Feather 328P w/wing
  #define RFM69_INT     3  // 
  #define RFM69_CS      4  //
  #define RFM69_RST     2  // "A"
  #define LED           13
#endif

RH_RF69 rf69(RFM69_CS, RFM69_INT);  //driver

int16_t packetnum = 0;  // packet counter, we increment per xmission

String str_out;
int dBv = 0;

void setup() 
{
  Serial.begin(9600);
  //while (!Serial) { delay(1); } // wait until serial console is open, remove if not tethered to computer

  pinMode(LED, OUTPUT);     
  pinMode(RFM69_RST, OUTPUT);
  digitalWrite(RFM69_RST, LOW);

  Serial.println("Feather RFM69 TX Test!");
  Serial.println();

  // manual reset
  digitalWrite(RFM69_RST, HIGH);
  delay(10);
  digitalWrite(RFM69_RST, LOW);
  delay(10);
  
  if (!rf69.init()) {
    Serial.println("RFM69 radio init failed");
    while (1);
  }
  Serial.println("RFM69 radio init OK!");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM (for low power module)
  // No encryption
  if (!rf69.setFrequency(RF69_FREQ)) {
    Serial.println("setFrequency failed");
  }

  // If you are using a high power RF69 eg RFM69HW, you *must* set a Tx power with the
  // ishighpowermodule flag set like this:
  rf69.setTxPower(20, true);  // range from 14-20 for power, 2nd arg must be true for 69HCW

  // The encryption key has to be the same as the one in the server
  uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
                    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  rf69.setEncryptionKey(key);
  
  pinMode(LED, OUTPUT);

  Serial.print("RFM69 radio @");  Serial.print((int)RF69_FREQ);  Serial.println(" MHz");
}



void loop() {
  delay(1000);  // Wait 1 second between transmits, could also 'sleep' here!
    
    // Compose output character
    dBv = analogRead(A0);
    str_out = String(dBv);
    static char *msg = str_out.c_str();
   
  char radiopacket[20] = *msg; 
  //char radiopacket[20] = "Hello World #";
  itoa(packetnum++, radiopacket+13, 10);
  Serial.print("Sending "); Serial.println(radiopacket);
  
  // Send a message!
  rf69.send((uint8_t *)radiopacket, strlen(radiopacket));
  rf69.waitPacketSent();

  // Now wait for a reply
  uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
  uint8_t len = sizeof(buf);

  if (rf69.waitAvailableTimeout(500))  { 
    // Should be a reply message for us now   
    if (rf69.recv(buf, &len)) {
      Serial.print("Got a reply: ");
      Serial.println((char*)buf);
      //Blink(LED, 50, 3); //blink LED 3 times, 50ms between blinks
    } else {
      Serial.println("Receive failed");
    }
  } else {
    Serial.println("No reply, is another RFM69 listening?");
  }
}

void Blink(byte PIN, byte DELAY_MS, byte loops) {
  for (byte i=0; i<loops; i++)  {
    digitalWrite(PIN,HIGH);
    delay(DELAY_MS);
    digitalWrite(PIN,LOW);
    delay(DELAY_MS);
  }
}

To send a number instead:

  // Send a binary value
  int x=1234;
  rf69.send((uint8_t *) &x, sizeof(x));
  rf69.waitPacketSent();

or formatted ASCII:

   char buf[10];
  // Send formatted value
  int x=1234;
  itoa(x,buf,10);
  rf69.send((uint8_t *) buf, strlen(buf)+1);  //+1 to transmit terminating zero byte
  rf69.waitPacketSent();

Ok thankyou, i'll get on this !

hi, got it working in the ascii mode! (not the just numbers one)
I'm not getting a reply to the transmitter probably because the "[RadioPacket]" method is not used?
can the ITOA String be place inside the [RadioPacket]? Var = itoa ?????
if not I'll just use it one way transmission

AND
thankyou so much!

Great, but if you have questions about code, post the code.

here is the Receiver side

#include <SPI.h>
#include <RH_RF69.h>

/************ Radio Setup ***************/
#define RF69_FREQ 915.0

#if defined (__AVR_ATmega328P__)  // Feather 328P w/wing
  #define RFM69_INT     3  // 
  #define RFM69_CS      4  //
  #define RFM69_RST     2  // "A"
  #define LED           13
#endif


// Singleton instance of the radio driver
RH_RF69 rf69(RFM69_CS, RFM69_INT);

int16_t packetnum = 0;  // packet counter, we increment per xmission

void setup() 
{
  Serial.begin(9600);
  //while (!Serial) { delay(1); } // wait until serial console is open, remove if not tethered to computer

  pinMode(LED, OUTPUT);     
  pinMode(RFM69_RST, OUTPUT);
  digitalWrite(RFM69_RST, LOW);

  Serial.println("Feather RFM69 RX Test!");
  Serial.println();

  // manual reset
  digitalWrite(RFM69_RST, HIGH);
  delay(10);
  digitalWrite(RFM69_RST, LOW);
  delay(10);
  
  if (!rf69.init()) {
    Serial.println("RFM69 radio init failed");
    while (1);
  }
  Serial.println("RFM69 radio init OK!");
  
  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM (for low power module)
  // No encryption
  if (!rf69.setFrequency(RF69_FREQ)) {
    Serial.println("setFrequency failed");
  }

  // If you are using a high power RF69 eg RFM69HW, you *must* set a Tx power with the
  // ishighpowermodule flag set like this:
  rf69.setTxPower(20, true);  // range from 14-20 for power, 2nd arg must be true for 69HCW

  // The encryption key has to be the same as the one in the server
  uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
                    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  rf69.setEncryptionKey(key);
  
  pinMode(LED, OUTPUT);

  Serial.print("RFM69 radio @");  Serial.print((int)RF69_FREQ);  Serial.println(" MHz");
}


void loop() {
 if (rf69.available()) {
    // Should be a message for us now   
    uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if (rf69.recv(buf, &len)) {
      if (!len) return;
      buf[len] = 0;
      Serial.print("Received [");
      Serial.print(len);
      Serial.print("]: ");
      Serial.println((char*)buf);
      Serial.print("RSSI: ");
      Serial.println(rf69.lastRssi(), DEC);

      if (strstr((char *)buf, "Hello World")) {
        // Send a reply!
        uint8_t data[] = "And hello back to you";
        rf69.send(data, sizeof(data));
        rf69.waitPacketSent();
        Serial.println("Sent a reply");
        Blink(LED, 40, 3); //blink LED 3 times, 40ms between blinks
      }
    } else {
      Serial.println("Receive failed");
    }
  }
}


void Blink(byte PIN, byte DELAY_MS, byte loops) {
  for (byte i=0; i<loops; i++)  {
    digitalWrite(PIN,HIGH);
    delay(DELAY_MS);
    digitalWrite(PIN,LOW);
    delay(DELAY_MS);
  }
}

The receiver side expects to receive ASCII character messages, and responds only to a "Hello World" message.