Is there any way to emulate a serial input?

Halli hallo,

I have a program which simply reads the input from an Arduino on COM4. It simply sends some decimal numbers, and my program draws something.

Is there someway that I can "emulate" the Arduino, that means

import processing.serial.*;
float bla = random(255);
String toWrite = ""+bla;

Serial myPort;

println(Serial.list());

// Open the port you are using at the rate you want:
myPort = new Serial(this, Serial.list()[0], 9600);

myPort.write(toWrite);

running this code, without ArrayIndexOutOfBounds 0 on line 10, without an Arduino connected to the PC.

Tagged:
Sign In or Register to comment.