 char readData() {
   Serial.println("w");
   while(1) {
+    
+    vcc.addValue(readVcc());
+    a0.addValue(analogRead(0));
+    a1.addValue(analogRead(1));
+    
     if(Serial.available() > 0) {
       return Serial.parseInt();
     }

    case 6 :
        //read analog value
        pin = readData();
        sum = 0;
        for(int i = 0; i < num; i++) {
          sum += analogRead(pin);
          //vcc.addValue(readVcc()); //continue averaging vcc during this process
        }
        avg = sum/num;
        Serial.println(avg); break;
    case 7 :
      //set DAC value
      writeDAC(); break;

int value = 0;
int cmd = 0;

RunningAverage vcc(100);
RunningAverage a0(10);
RunningAverage a1(10);

void setup()
{
