Serial monitor woes - other solutions are not working

Hi, I know some people have been having similar issues and I have Zadig installed and gone through the other issues shared by others.

My issue is that serial is and has always been tempermental with Daisy. at the moment I have it working in a basic oscillator . (following this thread - Daisy seed not showing on serial monitor - #7 by lukeyboyjj )

but I am trying to use the trill and the daisy together. when I try to get a serial response from a trill or in this trill file nothing happens, no com error - it seems to connect and says I can send a message but nothing is happening in the serial.

I am really stuck here. Are zadig drivers something i have to reinstall every time I change the file I am working on? Any ideas of what i can do?

here is the code that works
here is the code that is not working

// Title: oscillator

// Description: Control a sine wave freq with a knob

// Hardware: Daisy Seed

// Author: Ben Sergentanis

// Breadboard

// https://raw.githubusercontent.com/electro-smith/DaisyExamples/master/seed/Osc/resources/Osc_bb.png

// Schematic:

// https://raw.githubusercontent.com/electro-smith/DaisyExamples/master/seed/Osc/resources/Osc_schem.png




#include "DaisyDuino.h"




#include <Trill.h>




Trill trillSensor;

boolean touchActive = false;




DaisyHardware hw;




size_t num_channels;




static Oscillator osc;




float pitchknob;




void MyCallback(float **in, float **out, size_t size) {

  // Convert Pitchknob MIDI Note Number to frequency

  osc.SetFreq(mtof(pitchknob));

  for (size_t i = 0; i < size; i++) {

    float sig = osc.Process();




    for (size_t chn = 0; chn < num_channels; chn++) {

      out[chn][i] = sig;

    }

  }

}




void setup() {

  float sample_rate;

  // Initialize for Daisy pod at 48kHz

  hw = DAISY.init(DAISY_SEED, AUDIO_SR_48K);

  num_channels = hw.num_channels;

  sample_rate = DAISY.get_samplerate();




    // Initialise serial and touch sensor

  Serial.begin(9600);

  int ret = trillSensor.setup(Trill::TRILL_HEX);

  if(ret != 0) {

    Serial.println("failed to initialise trillSensor");

    Serial.print("Error code: ");

    Serial.println(ret);

  }

  Serial.println("hi I'm on");




  osc.Init(sample_rate);

  osc.SetFreq(440);

  osc.SetAmp(0.5);

  osc.SetWaveform(osc.WAVE_SIN);




  DAISY.begin(MyCallback);

}




void loop() { pitchknob = 24.0 + ((analogRead(A0) / 1023.0) * 60.0);




// Read 20 times per second

  delay(50);

  trillSensor.read();




  if(trillSensor.getNumTouches() > 0) {

    Serial.print(trillSensor.getNumTouches());

    Serial.print(" ");

    Serial.print(trillSensor.getNumHorizontalTouches());

    Serial.print(" ");




    for(int i = 0; i < trillSensor.getNumTouches(); i++) {

        Serial.print(trillSensor.touchLocation(i));

        Serial.print(" ");

        Serial.print(trillSensor.touchSize(i));

        Serial.print(" ");

    }

    for(int i = 0; i < trillSensor.getNumHorizontalTouches(); i++) {

        Serial.print(trillSensor.touchHorizontalLocation(i));

        Serial.print(" ");

        Serial.print(trillSensor.touchHorizontalSize(i));

        Serial.print(" ");

    }




    Serial.println("");

    touchActive = true;

  }

  else if(touchActive) {

    // Print a single line when touch goes off

    Serial.println("0 0");

    touchActive = false;

  }

 }

So I went through the files and copied the extra code from the not working serial file to the one that was working. AND IT WORKS….
so now I have two files with exactly the same code and the serial only works on one of them. Would anyone know how this happens, I have spent so long trying to fix this so I would love to avoid it happening again.

That is a bizarre issue. I unfortunately haven’t encountered anything like that so I’m not sure what’s happening.

So is the Trill code working now and displaying touch data via serial monitor? And was the issue that the serial monitor shows up but data wasn’t being displayed or were you not able to open/connect serial monitor at all?

Okay, so I finally solved it. I think there was a few things going on and my confusion made things a bit worse.

Some of my code for the serial was in a loop that wasn’t printing. I’m not sure if that’s what was the issue as I thought I’d check the code but it could’ve been

Secondly, the other thing that was causing issues was that I was using analog VCC and needed to be using digital VCC. I thought I had tried both but maybe I tried both when the serial monitor wasn’t set up correctly.

But it’s probably good for everyone to note that you need to use digital CVC with a sensor which is probably really obvious to most people

Glad to hear that it’s working!

Could you let me know more about this?