SERIAL PROBLEM

Hello @all,
I’m working on new installation and I need to receive the weight value from a digital balance.
I’ve tried with the serial monitor of arduino and it`s work perfectly but when I try to use with V4 anything happen.

With the serial monitor I simply send the message READ with CR and LF and I receive the string value.

Any idea to use it with V4.

Thanks

Aelf

I’ve write this software in processing in order to make and OSC bridge from the serial events:

import processing.serial.;
import oscP5.
;
import netP5.*;

Serial myPort; // Create object from Serial class
int lf = 10; // Linefeed in ASCII
int val; // Data received from the serial port
char[] arrays;
String inString; // Input string from serial port
String myString = null;

OscP5 oscP5;
NetAddress myRemoteLocation;

void setup()
{
frameRate(10);
size(10, 10);
// I know that the first port in the serial list on my mac
// is always my FTDI adaptor, so I open Serial.list()[0].
// On Windows machines, this generally opens COM1.
// Open whatever port is the one you’re using.
String portName = Serial.list()[0];
myPort = new Serial(this, portName, 9600);
//myPort.buffer(18);
oscP5 = new OscP5(this, 12000);
myRemoteLocation = new NetAddress(“127.0.0.1”, 9999);
}

void draw() {

myPort.write(82);
myPort.write(69);
myPort.write(65);
myPort.write(68);
myPort.write(13);

while (myPort.available() > 0) {
myString = myPort.readStringUntil(lf);
if (myString != null) {
OscMessage myMessage = new OscMessage("/test");
myMessage.add(myString); /* add an int to the osc message */
oscP5.send(myMessage, myRemoteLocation);
println(myString);
}
}
}

the most easy way to use arduino with vvvv is firmata, no need for low level byte juggling:

better even: have a look at:

girlpower\IO\Arduino\Arduino_without_Firmata.v4p

and read the comments carefully. it should explain all you need.

Hello Joreg,
I’m using an industrial balance directly connect to the pc via USB port.

that is fine. and the example i mentioned answers your initial question.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.