assigning differant values to char?

i have “messageForRX” im looking to assign it differant if a button is pressed like MessageForRX = Triangle say it its pressed the im sending messageforrx

/*
 Example sketch for the PS4 Bluetooth library - developed by Kristian Lauszus
 For more information visit my blog: http://blog.tkjelectronics.dk/ or
 send me an e-mail:  kristianl@tkjelectronics.com
 */
#include <PS4BT.h>
#include <usbhub.h>
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif

USB Usb;
//USBHub Hub1(&Usb); // Some dongles have a hub inside
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instance of the PS4BT class in two ways */
// This will start an inquiry and then pair with the PS4 controller - you only have to do this once
// You will need to hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in paring mode
//PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press the PS button on the device
PS4BT PS4(&Btd);

#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial xbee(5, 4); // TX, RX
int LYVALUE;
int LXVALUE;
int oldLYvalue;
int oldLXvalue;
int RYVALUE;
int RXVALUE;
int oldRYvalue;
int oldRXvalue;
int Forward;
int Backward;
int Movement;
int oldmove;
char messageForRX[15];
boolean Frwrd = false;
boolean Bkwrd = false;
bool printAngle, printTouch;
uint8_t oldL2Value, oldR2Value;

void setup() {

  Serial.begin(9600);
#if !defined(__MIPSEL__)
  while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
  if (Usb.Init() == -1) {
    Serial.print(F("\r\nOSC did not start"));
    while (1); // Halt
  }
  Serial.print(F("\r\nPS4 Bluetooth Library Started"));
  xbee.begin(9600);
}
void loop() {
  Usb.Task();

  if (PS4.connected()) {
    if (PS4.getAnalogHat(LeftHatX) > 137 || PS4.getAnalogHat(LeftHatX) < 117 || PS4.getAnalogHat(LeftHatY) > 137 || PS4.getAnalogHat(LeftHatY) < 117 || PS4.getAnalogHat(RightHatX) > 137 || PS4.getAnalogHat(RightHatX) < 117 || PS4.getAnalogHat(RightHatY) > 137 || PS4.getAnalogHat(RightHatY) < 117)
    {
      //Stick Values
      LYVALUE = PS4.getAnalogHat(LeftHatY);
      LYVALUE = map(LYVALUE, 0, 255, 130, 45);
      LXVALUE = PS4.getAnalogHat(LeftHatX);
      LXVALUE = map(LXVALUE, 0, 255, 39, 120);

      RYVALUE = PS4.getAnalogHat(RightHatY);
      RXVALUE = PS4.getAnalogHat(RightHatX);

    }

    if (PS4.getAnalogButton(L2) || PS4.getAnalogButton(R2)) { // These are the only analog buttons on the PS4 controller
      Serial.print(F("\r\nL2: "));
      Serial.print(PS4.getAnalogButton(L2));
      Serial.print(F("\tR2: "));
      Serial.print(PS4.getAnalogButton(R2));
    }
    //==================================================
    if (PS4.getAnalogButton(R2) != oldR2Value && !Bkwrd) {// Only write value if it's different
      PS4.setRumbleOn(PS4.getAnalogButton(L2), PS4.getAnalogButton(R2));
      oldR2Value = PS4.getAnalogButton(R2);
      Forward = PS4.getAnalogButton(R2);
      Forward = map(Forward, 0, 255, 130, 45);
      Frwrd = true;
      Movement = (Forward);
    }
    else {
      Frwrd = false;
    }
    //==================================================
    if (PS4.getAnalogButton(L2) != oldL2Value && !Frwrd) { // Only write value if it's different
      PS4.setRumbleOn(PS4.getAnalogButton(L2), PS4.getAnalogButton(R2));
      oldL2Value = PS4.getAnalogButton(L2);
      Backward = PS4.getAnalogButton(L2);
      Backward = map(Backward, 0, 255, 130, 45);
      Bkwrd = true;
      Movement = (Backward);
    }
    else {
      Bkwrd = false;
    }

    if (PS4.getButtonClick(PS)) {
      Serial.print(F("\r\nPS"));
      PS4.disconnect();
    }
    else {
      if (PS4.getButtonClick(TRIANGLE)) {
        Serial.print(F("\r\nTraingle"));
        messageForRX = ("Triangle");
      }
      if (PS4.getButtonClick(CIRCLE)) {
        Serial.print(F("\r\nCircle"));
        messageForRX = ("Circle");
      }
      if (PS4.getButtonClick(CROSS)) {
        Serial.print(F("\r\nCross"));
        messageForRX = ("Cross");
       // PS4.setLedFlash(10, 10); // Set it to blink rapidly
      }
      if (PS4.getButtonClick(SQUARE)) {
        Serial.print(F("\r\nSquare"));
        messageForRX = ("Square");
        //PS4.setLedFlash(0, 0); // Turn off blinking
      }

      if (PS4.getButtonClick(UP)) {
        Serial.print(F("\r\nUp"));
        messageForRX = ("Up");
        //PS4.setLed(Red);
      } if (PS4.getButtonClick(RIGHT)) {
        Serial.print(F("\r\nRight"));
        messageForRX = ("Right");
        //PS4.setLed(Blue);
      } if (PS4.getButtonClick(DOWN)) {
        Serial.print(F("\r\nDown"));
        messageForRX = ("Down");
        //PS4.setLed(Yellow);
      } if (PS4.getButtonClick(LEFT)) {
        Serial.print(F("\r\nLeft"));
        messageForRX = ("Left");
        //PS4.setLed(Green);
      }

      if (PS4.getButtonClick(L1))
        Serial.print(F("\r\nL1"));
        messageForRX = ("L1");
      if (PS4.getButtonClick(L3))
        Serial.print(F("\r\nL3"));
        messageForRX = ("L3");
      if (PS4.getButtonClick(R1))
        Serial.print(F("\r\nR1"));
        messageForRX = ("R1");
      if (PS4.getButtonClick(R3))
        Serial.print(F("\r\nR3"));
        messageForRX = ("R3");

      if (PS4.getButtonClick(SHARE))
        Serial.print(F("\r\nShare"));
        messageForRX = ("Share");
      if (PS4.getButtonClick(OPTIONS)) {
        Serial.print(F("\r\nOptions"));
        messageForRX = ("Options");
        printAngle = !printAngle;
      }
    }
  }
  delay(10);
  if (Movement < (oldmove -2) ||movement > (oldmove +2)  || LXVALUE < (oldLXvalue - 5) || LXVALUE > (oldLXvalue + 5) || RXVALUE < (oldRXvalue - 5) || RXVALUE > (oldRXvalue + 5) || RYVALUE < (oldRYvalue - 5) || RYVALUE > (oldRYvalue + 5)) {
    Serial.print(F("<"));
    Serial.print(messageForRX);
    Serial.print(F(","));
    Serial.print(Movement, DEC);
    Serial.print(",");
    Serial.print(LXVALUE, DEC);
    Serial.print(F(","));
    Serial.print(RYVALUE, DEC);
    Serial.print(F(","));
    Serial.print(RXVALUE, DEC);
    Serial.println(F(">"));

    xbee.print(F("<"));
    xbee.print(F("LXYValues"));
    xbee.print(F(","));
    xbee.print(LYVALUE, DEC);
    xbee.print(",");
    xbee.print(LXVALUE, DEC);
    xbee.print(F(","));
    xbee.print(RYVALUE, DEC);
    xbee.print(F(","));
    xbee.print(RXVALUE, DEC);
    xbee.println(F(">"));


    oldLXvalue = LXVALUE;
    oldLYvalue = LYVALUE;
    oldRXvalue = RXVALUE;
    oldRYvalue = RYVALUE;
  }
  oldmove = Movement;
}
strcpy(messageForRx, "new Text");

A FAR more efficient, and far safer, way to do it is:

char *msgForRx = "some text";
...
msgForRx = "some other text";

Regards, Ray L.

ray when i try what you suggested it tells me,* Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

PS4controlTX.ino: In function 'void loop()': PS4controlTX:114: error: 'msgForRx' was not declared in this scope PS4controlTX:118: error: 'msgForRx' was not declared in this scope PS4controlTX:122: error: 'msgForRx' was not declared in this scope PS4controlTX:127: error: 'msgForRx' was not declared in this scope PS4controlTX:133: error: 'msgForRx' was not declared in this scope PS4controlTX:137: error: 'msgForRx' was not declared in this scope PS4controlTX:141: error: 'msgForRx' was not declared in this scope PS4controlTX:145: error: 'msgForRx' was not declared in this scope PS4controlTX:151: error: 'msgForRx' was not declared in this scope 'msgForRx' was not declared in this scope

This report would have more information with "Show verbose output during compilation"

and yes i changed char *msgForRX = "";

ray when i try what you suggested it tells me,

Posting error messages without the corresponding code is simply a waste of time.

Do you like having your time wasted?

sense you asked so nicley

/*
 Example sketch for the PS4 Bluetooth library - developed by Kristian Lauszus
 For more information visit my blog: http://blog.tkjelectronics.dk/ or
 send me an e-mail:  kristianl@tkjelectronics.com
 */
#include <PS4BT.h>
#include <usbhub.h>
// Satisfy the IDE, which needs to see the include statment in the ino too.
#ifdef dobogusinclude
#include <spi4teensy3.h>
#include <SPI.h>
#endif

USB Usb;
//USBHub Hub1(&Usb); // Some dongles have a hub inside
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
/* You can create the instance of the PS4BT class in two ways */
// This will start an inquiry and then pair with the PS4 controller - you only have to do this once
// You will need to hold down the PS and Share button at the same time, the PS4 controller will then start to blink rapidly indicating that it is in paring mode
//PS4BT PS4(&Btd, PAIR);
// After that you can simply create the instance like so and then press the PS button on the device
PS4BT PS4(&Btd);

#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial xbee(5, 4); // TX, RX
int LYVALUE;
int LXVALUE;
int oldLYvalue;
int oldLXvalue;
int RYVALUE;
int RXVALUE;
int oldRYvalue;
int oldRXvalue;
int Forward;
int Backward;
int Movement;
int oldmove;
const byte numChars = 32;
char *msgForRX = "";
boolean Frwrd = false;
boolean Bkwrd = false;
bool printAngle, printTouch;
uint8_t oldL2Value, oldR2Value;

void setup() {

  Serial.begin(9600);
#if !defined(__MIPSEL__)
  while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
#endif
  if (Usb.Init() == -1) {
    Serial.print(F("\r\nOSC did not start"));
    while (1); // Halt
  }
  Serial.print(F("\r\nPS4 Bluetooth Library Started"));
  xbee.begin(9600);
}
void loop() {
  Usb.Task();

  if (PS4.connected()) {
    if (PS4.getAnalogHat(LeftHatX) > 137 || PS4.getAnalogHat(LeftHatX) < 117 || PS4.getAnalogHat(LeftHatY) > 137 || PS4.getAnalogHat(LeftHatY) < 117 || PS4.getAnalogHat(RightHatX) > 137 || PS4.getAnalogHat(RightHatX) < 117 || PS4.getAnalogHat(RightHatY) > 137 || PS4.getAnalogHat(RightHatY) < 117)
    {
      //Stick Values
      LYVALUE = PS4.getAnalogHat(LeftHatY);
      LYVALUE = map(LYVALUE, 0, 255, 130, 45);
      LXVALUE = PS4.getAnalogHat(LeftHatX);
      LXVALUE = map(LXVALUE, 0, 255, 39, 120);

      RYVALUE = PS4.getAnalogHat(RightHatY);
      RXVALUE = PS4.getAnalogHat(RightHatX);

    }

    if (PS4.getAnalogButton(L2) || PS4.getAnalogButton(R2)) { // These are the only analog buttons on the PS4 controller
      Serial.print(F("\r\nL2: "));
      Serial.print(PS4.getAnalogButton(L2));
      Serial.print(F("\tR2: "));
      Serial.print(PS4.getAnalogButton(R2));
    }
    //==================================================
    if (PS4.getAnalogButton(R2) != oldR2Value && !Bkwrd) {// Only write value if it's different
      PS4.setRumbleOn(PS4.getAnalogButton(L2), PS4.getAnalogButton(R2));
      oldR2Value = PS4.getAnalogButton(R2);
      Forward = PS4.getAnalogButton(R2);
      Forward = map(Forward, 0, 255, 130, 45);
      Frwrd = true;
      Movement = (Forward);
    }
    else {
      Frwrd = false;
    }
    //==================================================
    if (PS4.getAnalogButton(L2) != oldL2Value && !Frwrd) { // Only write value if it's different
      PS4.setRumbleOn(PS4.getAnalogButton(L2), PS4.getAnalogButton(R2));
      oldL2Value = PS4.getAnalogButton(L2);
      Backward = PS4.getAnalogButton(L2);
      Backward = map(Backward, 0, 255, 130, 45);
      Bkwrd = true;
      Movement = (Backward);
    }
    else {
      Bkwrd = false;
    }

    if (PS4.getButtonClick(PS)) {
      Serial.print(F("\r\nPS"));
      PS4.disconnect();
    }
    else {
      if (PS4.getButtonClick(TRIANGLE)) {
        Serial.print(F("\r\nTraingle"));
       msgForRx = "Triangle";
      }
      if (PS4.getButtonClick(CIRCLE)) {
        Serial.print(F("\r\nCircle"));
        msgForRx = "Circle";
      }
      if (PS4.getButtonClick(CROSS)) {
        Serial.print(F("\r\nCross"));
        msgForRx = "Crosss";
       // PS4.setLedFlash(10, 10); // Set it to blink rapidly
      }
      if (PS4.getButtonClick(SQUARE)) {
        Serial.print(F("\r\nSquare"));
        msgForRx = "Square";
        //PS4.setLedFlash(0, 0); // Turn off blinking
      }

      if (PS4.getButtonClick(UP)) {
        Serial.print(F("\r\nUp"));
        msgForRx = "Up";
        //PS4.setLed(Red);
      } if (PS4.getButtonClick(RIGHT)) {
        Serial.print(F("\r\nRight"));
        msgForRx = "Right";
        //PS4.setLed(Blue);
      } if (PS4.getButtonClick(DOWN)) {
        Serial.print(F("\r\nDown"));
       msgForRx = "Down";
        //PS4.setLed(Yellow);
      } if (PS4.getButtonClick(LEFT)) {
        Serial.print(F("\r\nLeft"));
       msgForRx = "Left";
        //PS4.setLed(Green);
      }

      if (PS4.getButtonClick(L1))
        Serial.print(F("\r\nL1"));
       msgForRx = "L1";
      if (PS4.getButtonClick(L3))
        Serial.print(F("\r\nL3"));
        msgForRx = "L3";
      if (PS4.getButtonClick(R1))
        Serial.print(F("\r\nR1"));
        msgForRx = "R1";
      if (PS4.getButtonClick(R3))
        Serial.print(F("\r\nR3"));
       msgForRx = "R3";

      if (PS4.getButtonClick(SHARE))
        Serial.print(F("\r\nShare"));
        msgForRx = "Share";
      if (PS4.getButtonClick(OPTIONS)) {
        Serial.print(F("\r\nOptions"));
       msgForRx = "Options";
        printAngle = !printAngle;
      }
    }
  }
  delay(10);
  if (Movement < (oldmove -2) || Movement > (oldmove +2)  || LXVALUE < (oldLXvalue - 5) || LXVALUE > (oldLXvalue + 5) || RXVALUE < (oldRXvalue - 5) || RXVALUE > (oldRXvalue + 5) || RYVALUE < (oldRYvalue - 5) || RYVALUE > (oldRYvalue + 5)) {
    Serial.print(F("<"));
    Serial.print(messageForRX);
    Serial.print(F(","));
    Serial.print(Movement, DEC);
    Serial.print(",");
    Serial.print(LXVALUE, DEC);
    Serial.print(F(","));
    Serial.print(RYVALUE, DEC);
    Serial.print(F(","));
    Serial.print(RXVALUE, DEC);
    Serial.println(F(">"));

    xbee.print(F("<"));
    xbee.print(F("LXYValues"));
    xbee.print(F(","));
    xbee.print(LYVALUE, DEC);
    xbee.print(",");
    xbee.print(LXVALUE, DEC);
    xbee.print(F(","));
    xbee.print(RYVALUE, DEC);
    xbee.print(F(","));
    xbee.print(RXVALUE, DEC);
    xbee.println(F(">"));


    oldLXvalue = LXVALUE;
    oldLYvalue = LYVALUE;
    oldRXvalue = RXVALUE;
    oldRYvalue = RYVALUE;
  }
  oldmove = Movement;
}

Well, where is "msgForRx" declared?

is this not sufficient having it before the stup? char *msgForRX = "";

Look carefully at the error messages, and then at reply #7

it seems my glasses need to be cleaned..... thank you