Processing, USB Serial and Teensy 3.0/3.1

Status
Not open for further replies.

keithg

Well-known member
I have an arduino running a sketch controlling a heater. I also have a Processing sketch to graph the output. I want to move this to a Teensy 3.0. I have set everything else up on the Teensy 3.0 (sensors all working over SPI, display, buttons). The system works. Now to graph a run... No go. I have searched and cannot seem to find a concise reason why it does not communicate. I am guessing it has to do with the virtual USB serial port, but have not yet found a solution.

Previously, I was using an Uno and had the baud rate set at 9600 in both the processing sketch and the Arduino sketch. I can have the arduino running and start processing and it causes a reboot of the arduino, it connects and runs.

Arduino:
Code:
void setup()
{ 
  Serial.begin(9600);         //initialize the serial link for processing
...

Processing:
Code:
  println(Serial.list());                                           // * Initialize Serial
  myPort = new Serial(this, Serial.list()[0], 9600);              //   Communication with
  myPort.bufferUntil(10);                                           //   the Arduino until CR character

I have read that the speed of the port is closer to 460800, but I have tried this value in both sketches and still do not get communication. I can watch the serial port from the arduino environment and the data stream is there, but Processing just says
"Error, disabling serialEvent() for COM6
null"

can any one give me any pointers on how to get this communicating to Processing?

I just was able to make it connect... The only way I can make it connect and graph the serial output is when I start processing before the code on the teensy fully boots. If I do so, it will connect and run. Is there an easier way?

Regards,

Keith
 
I believe that is what is happening. I have seen mention of doing some wait command on the serial port. Is that what is appropriate here? I intend to run the code currently with the serial port for debugging/tuning and will be using it periodically without using/needing the serial port connection. Should I set up a time out on that (if the serial port doe snot appear in 60 seconds for example). I am a bit unclear as to how to do this.

Regards,

Keith
 
Status
Not open for further replies.
Back
Top