Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Sketch stopped working in Processing 2.0.1

$
0
0
Good of you to respond. Here is the code I was using just to see whether I could read the raw data:

import processing.serial.*;
String textValue = "";
Serial cellLogPort; // [3] on the port list (Com 9)
int lf = 10;    // Linefeed in ASCII
String cellLogData = null; //holds the incoming raw string from the Cell log
//***********************************************************************************************************************************************
void setup() 
  {
    println(Serial.list()); //lists ports for debugging
    //cellLogPort = new Serial(this, Serial.list()[0], 128000); //Cell Log serial parameters filched by looking at the relevant .ini file in logview
    cellLogPort = new Serial(this, "COM4", 128000, 'N', 8, 1.0);
    cellLogPort.buffer(1);
    delay(500);
  }

//***********************************************************************************************************************************************
void draw() //main loop
  {
    int inByte = 1;
    String instr = "A"; //set it to a dummy to see what changes
  while (cellLogPort.available() > 0)
    {
    print("cellLogPort.available() = ");
    println(cellLogPort.available());
    instr = cellLogPort.readString();
    print("instr = ");
    println(instr);
    print("cellLogPort.available() = ");
    println(cellLogPort.available());
    print("cellLogPort = ");
    println(cellLogPort);
    println();
    }
  }


The device was set to send a semi-colon-separated string containing a number of values - mostly cell voltages. Communication was via the USB port. This worked fine in 1.5.1 but not 2.0.1

Viewing all articles
Browse latest Browse all 1768

Trending Articles