weather station wireless

hello to all

I’m making a small weather station … now I’m testing rf modules 433 MHz, because I would have sensors (temperature, wind) on the outside, and the “central” inside the house.
So I would like Arduino 1 (transmitter) sends variable data from sensor to the central station (arduino mega,receiver) .
For now I am only able to send a single data element.

how should I do to be able to send and read more data? eg. temperature, wind speed,

I enclose the sketch I use to send variables

thanks for the help

Transmitter

#include <VirtualWire.h>


const int led_pin = 11;
const int transmit_pin = 8;
const int receive_pin = 52;
const int transmit_en_pin = 3;

float temp = 19.20 ; //EXAMPLE

void setup()
{
    // Initialise the IO and ISR
    vw_set_tx_pin(transmit_pin);
    vw_set_rx_pin(receive_pin);
    vw_set_ptt_pin(transmit_en_pin);
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec
    pinMode(led_pin, OUTPUT);
}

byte count = 1;

void loop()
{
  char msgt[6] ;
  dtostrf(temp,2,2, msgt);
    
  msgt[6] = count;
  digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
  vw_send((uint8_t *)msgt, 7);
  vw_wait_tx(); // Wait until the whole message is gone
 
  digitalWrite(led_pin, LOW);
  delay(1000);
  count = count + 1;
}

Receiver

#include <VirtualWire.h>

const int led_pin = 13;
const int transmit_pin = 12;
const int receive_pin = 52;
const int transmit_en_pin = 3;

void setup()
{
    delay(1000);
    Serial.begin(9600);	// Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_tx_pin(transmit_pin);
    vw_set_rx_pin(receive_pin);
    vw_set_ptt_pin(transmit_en_pin);
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);	 // Bits per sec

    vw_rx_start();       // Start the receiver PLL running

    pinMode(led_pin, OUTPUT);
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;

        digitalWrite(led_pin, HIGH); // Flash a light to show received good message
	// Message with a good checksum received, dump it.
	Serial.print("Got: ");
	
	for (i = 0; i < buflen; i++)
	{
	    Serial.print(char(buf [i] ));
	    Serial.print(' ');
	}
	Serial.println();
        digitalWrite(led_pin, LOW);
    }
}

You have the wonderful opportunity to create your own protocol. At the moment, you have a virtual wire; you send a byte of data on one end, and the byte pops out on the other end. To send multiple pieces of data you need to devise someway of packaging the data, sending it, then unpacking and interpreting it.

I know .. :~ but I'm not so experienced and I need a hand !! :cold_sweat:

A good way to gain experience is to go through the program that you already have and figure out what each line does. If that includes learning something about the programming language, great! If you have specific questions about a particular feature, post those and people will be happy to answer. However, very few people will be willing to write your program for you.

Edit: the example you have chosen is not a good one, as there are some program lines that don't do anything useful. I suggest to download the examples from the VirtualWire site and study them, along with the VirtualWire documentation.