Transmitting Analog Signal

Please help me correct this code. It is the offspring of an analog pressure transducer code (MPa converted to PSI) and a 433 Mhz transmission code. When uploaded, the pressure transducer prints to the serial monitor and the transmitter transmits, however, the message transmitted is not what is printed on the serial monitor. Instead the message is letter for letter what is written after const char *msg. How can I get the transmitted message to be the converted PSI value printing on the monitor?

// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

void setup()

Serial.begin(9600); // Debugging only
void measurePressure(){
int raw = analogRead(A0);
float voltage = (float) raw * 5.0 / 1024.0; // voltage at the pin of the Arduino
float pressure_kPa = (voltage - 0.5) / 4.0 * 1200.0; // voltage to pressure
float pressure_psi = (pressure_kPa * 0.14503773773020923)+1.15; // kPa to psi


vw_set_tx_pin(12); // Sets pin D12 as the TX pin
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(4000); // Bits per sec

void loop()
const char *msg = “pressure_psi:”; // Message to be sent
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg)); //Sending the message
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13, false); // Turn the LED off.
delay(50); // A short gap.

Moderator edit: language. Do not repeat.

We need all your code. Where is the "measurePressure()" function? Where does it put the pressure it seems to measure?

What's that? Your breaking up, Keith sdlfssfldslkfdfjlsd. Just kidding but for real I do not know anything about code. I took one code i found and combined it with another. They both still work combined but they are not working together. How do I change the Const msg line there in the loop?

Instead the message is letter for letter what is written after const char *msg.

Because that is what YOU told it to transmit.

You COULD create an array (not const) that you could actually write to, populate it using sprintf(), and send that.

Just replace the Serial prints in measurePressure() with va_sends()