XBee to Uno to DAC

Hello,
I'm terrible at this but learning by solving one problem at a time. What I am doing is sending voltage changes from an analog potentiometer on Uno #1 via Xbee to a receiving Uno #2 and lighting an LED via pin 3 using PWM. So far, I'm good.

I have now added a DAC (Sparkfun MCP4725) to send smooth DC voltages to a receiving unit for measurement. I can not understand how to translate the pot values from the sending Uno (mapped to 0-255 for PWM) that show up on the serial bus in Uno#2.

I have the DAC connected and tested with the example sine wave sketch and the LED on the DAC out responds correctly. I am using the Adafruit library for the DAC but ironically it works better with the Sparkfun DAC I am now using.

[The overall idea is to create a wireless expression pedal for a guitar processor. I want to use DC instead of changing to MIDI CC messages and sending those to the processor.]

Any guidance is appreciated to the fullest.
Chad

/*   ~ Simple Arduino - xBee Receiver sketch ~

  Read an PWM value from Arduino Transmitter to fade an LED
  The receiving message starts with '<' and closes with '>' symbol.
  
  Dev: Michalis Vasilakis // Date:2/3/2016 // Info: www.ardumotive.com // Licence: CC BY-NC-SA                    */

#include <Wire.h>
#include <Adafruit_MCP4725.h>

Adafruit_MCP4725 dac;


//Constants
const int ledPin = 3; //Led to Arduino pin 3 (PWM)

//Variables
bool started= false;//True: Message is started
bool ended  = false;//True: Message is finished 
char incomingByte ; //Variable to store the incoming byte
char msg[3];    //Message - array from 0 to 2 (3 values - PWM - e.g. 240)
byte index;     //Index of array
#define MCP4725_ADDR 0x60 
#define DAC_RESOLUTION    (12)
void setup() {
  Wire.begin();
  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module
  pinMode(ledPin, OUTPUT);
  
  dac.begin(0x60);
  
  

}

void loop() {
  
    while (Serial.available()>0){
    //Read the incoming byte
    incomingByte = Serial.read();
    //Start the message when the '<' symbol is received
    if(incomingByte == '<')
    {
     started = true;
     index = 0;
     msg[index] = '\0'; // Throw away any incomplete packet
   }
   //End the message when the '>' symbol is received
   else if(incomingByte == '>')
   {
     ended = true;
     break; // Done reading - exit from while loop!
   }
   //Read the message!
   else
   {
     if(index < 4) // Make sure there is room
     {
       msg[index] = incomingByte; // Add char to array
       index++;
       msg[index] = '\0'; // Add NULL to end
     }
   }
 }
 
 if(started && ended)
 {
   int value = atoi(msg);
   analogWrite(ledPin, value);
   Serial.write(value); //Only for debugging
   index = 0;
   msg[index] = '\0';
   started = false;
   ended = false;
   dac.setVoltage(0, false);
 }

}

Here's how I fixed this:
I gave up on the I2C DAC for now and wired up an MCP4901 DAC instead using SPI. This proved to be way easier.
Next is to figure out how to repeat serial values on the receiver to keep the voltage at last reading.

Setup the chip.....

/ Set up the DAC. 
// First argument: model (MCP4901, MCP4911, MCP4921)
// Second argument: SS pin (10 is preferred)
// (The third argument, the LDAC pin, can be left out if not used)
DAC_MCP49x1 dac(DAC_MCP49x1::MCP4901, SS_PIN);
void setup() {
  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module
  pinMode(ledPin, OUTPUT);

  // Set the SPI frequency to 1 MHz (on 16 MHz Arduinos), to be safe.
  // DIV2 = 8 MHz works for me, though, even on a breadboard.
  // This is not strictly required, as there is a default setting.
  dac.setSPIDivider(SPI_CLOCK_DIV2);
  // Use "port writes", see the manual page. In short, if you use pin 10 for
  // SS (and pin 7 for LDAC, if used), this is much faster.
  // Also not strictly required (no setup() code is needed at all).
  dac.setPortWrite(true);
}

After adding only 1 line of code in Loop it worked first try.

dac.output(value);  // Send 0-255 to DAC