title: Need to know how to send HEX values via SoftwareSerial on Arduino Uno
body: <p>I’m trying to write Android Uno code to send HEX values via SoftwareSerial but when watching the Serial Monitor the output isn’t what I expected or wanted, and I am not experienced enough yet to know what to do next.</p>
  <p>I don’t know where the FFFFs come from to be able to eliminate them.</p>
  <p>My desired output is:</p>
  <pre><code>&lt;br&gt;
  AA130120&lt;br&gt;
  AA0400AE
  </code></pre>
  <p>What I get is:</p>
  <pre><code>&lt;br&gt;
  FFFFFFFFAA1311E&lt;br&gt;
  FFFFFFAA20
  </code></pre>
  <p>My code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;SoftwareSerial.h&gt;
  // Define the RX and TX pins to establish UART communication with the MP3 Player Module.
  #define Pin_RX 0 // to RX
  #define Pin_TX 1 // to TX
  #define d_sleep 10000
  
  // Define the required MP3 Player Commands:
  static byte ccPlay[]   = {0xAA, 0x02, 0x00, 0xAC}; // Play:
  static byte ccSetVol[] = {0xAA, 0x13, 0x01, 0x20}; // Set Volume (00-30):  
  
  // Define the Serial MP3 Player Module.
  SoftwareSerial MP3(Pin_RX, Pin_TX);
  
  void setup() {
    // Initiate the serial monitor.
    Serial.begin(9600);
  }
  
  void loop() { // Play a song.
    ccSetVol[3] = {0x1E};
    send_command_to_MP3_player(ccSetVol, 4);
    delay(d_sleep);
    send_command_to_MP3_player(ccPlay, 4);
    delay(d_sleep);
  }
  
  void send_command_to_MP3_player(int8_t command[], int len){
    //Serial.print(&quot;\nMP3 Command =&gt; &quot;);
    for (int i=0; i&lt;len; i++) {
      MP3.write(command[i]);
      Serial.print(command[i], HEX); 
    }
    delay(100);
  }
  </code></pre>