Virtual wire, using strcat

I have small issue appending 3 arrays, i can append 2 arrays using strcat function but i cannot do it with 3 arrays. Basically im sending temperature values , max and min values to the receiver and printing on lcd. But i can only send temp value and min or max value but i cant do it with with all three. here is the small part of the code.

[#include <VirtualWire.h>  //transmitter code 
  int reading;
  char Signal[20];  
  char Signal2[20];  
  char Signal3[20]; 
  int mintemp=100;
  int maxtemp=0; 
int tempPin = 7;  // |  RF transmitter library
void setup(){   
 
  Serial.begin(9600);                           
  vw_set_ptt_inverted(true);                      
  vw_set_tx_pin(12);                            
  vw_setup(4800);                              
}                                                
void loop(){                                      
 
int Temp = ((5.0 * analogRead(tempPin) * 100.0) / 1024); 
    if(Temp>maxtemp)
     maxtemp=Temp;
   if(Temp<mintemp)
     mintemp=Temp;                      
  sprintf(Signal,"%i",Temp);                    
  sprintf(Signal2,"%i",mintemp);
  sprintf(Signal3,"%i",maxtemp);
   
  strcat(Signal, Signal2);
  
   // i tried using strcat(Signal, Signal2); strcat(Signal, Signal3); but it didnt work
  
  vw_send((uint8_t *)Signal,strlen(Signal));                        
  vw_wait_tx();                                 
                                     
}]


[code][[code][//Receiver code
#include <VirtualWire.h>                

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int i;
                         
void setup(){                            
  lcd.begin(16, 2);
  Serial.begin(9600);                     
  vw_set_ptt_inverted(true);            
  vw_set_rx_pin(12);                    
  vw_setup(4800);                       
  pinMode(13, OUTPUT);                  
  vw_rx_start();                        
}                                        
void loop(){                             
  delay(2000);
    uint8_t buf[VW_MAX_MESSAGE_LEN];      
  uint8_t buflen = VW_MAX_MESSAGE_LEN;  
  lcd.setCursor(0,0);  
  lcd.print("Temp:");
  
  if (vw_get_message(buf, &buflen))    
  {
    for (i=0;i<2;i++)               
  {
  Serial.write(buf[i]);                
  lcd.write(buf[i]);
   // Write the first bytes on the LCD
  }  
  Serial.println();                    
 lcd.print((char)223);                      
  lcd.print("C"); 
  lcd.setCursor(0,1);
    lcd.print("Min:"); 
    for (i=2;i<4;i++)              // Get middle two  bytes
    {
      Serial.write(buf[i]);                
      lcd.write(buf[i]);                    
    }  
  lcd.print((char)223);                      
  lcd.print("C");
  lcd.setCursor(9,9);
    lcd.print("Max:"); 
    for (i=4;i<6;i++)         // Get last two  bytes     
    {
      Serial.write(buf[i]);               
      lcd.write(buf[i]);                    
    }  
  lcd.print((char)223);                      
  }
}]

]

It is a lot easier to transmit an array of integers. I use a struct to be able to combine floats and integers and bytes. The next example code lines are for an array of integers.

// Transmitter
int myData[3];

myData[0] = Temp;
myData[1] = mintemp;
myData[2] = maxtemp;

vw_send( (uint8_t *) myData, sizeof( myData));


// In the receiver, copy the data into an array, or set a pointer to 'buf'.
// This uses a pointer.
int *pData = (int *) buf;
for( int i=0; i<3; i++)
{
  Serial.print( pData[i]);
  Serial.print(", ");
}
Serial.println();

How about getting the three values directly into the character array?

snprintf(yourcharbuffer, sizeof(yourcharbuffer),  "%i %i %i", Temp, mintemp, maxtemp);

Just make sure the buffer is big enough to hold the maximum required length.

Thanks for the reply guys.

(Sterretje)
Yh i tried it, but i get display on lcd as
Temp:20c,
Min:1c Max:5
probably soemething to do with the receiver byte count code.

(koepel)
on the transmitter side ive added the code and everyting is fine, but on receiver code, i dont get it how to add tht code, i tried it but had issues. im not good at programming. :confused:

(Delta_G)
the minimum and maximum values dont work, just random numbers pop out,.
for example minimum becomes 16 even when temperature value never was 16 at one point

i tried it but had issues.

And you won't tell us what those are.

i mean it doessnt compile.

thanks for the help guys i think i solved it, i used the funtion below. but i had to play around with for loop statements in receiver code. i tested max it worked fine, dont have anything to test min lol. but i think its fine.
thanks again guys.

sprintf(Signal,"%i %i %i", Temp, mintemp,maxtemp);