7 years, 4 months ago.

processing Mbed

hello,

How to serial Mbed in processing ? I use this program in processing :

import processing.serial.*; import org.mbed.RPC.*;

mbed mbed; PwmOut led1; PwmOut led2; void setup() { size(480, 120); smooth(); mbed = new SerialRxTxRPC("COM5", 9600); led1 = new PwmOut(mbed, mbedRPC.LED1); led2 = new PwmOut(mbed, mbedRPC.LED2);

}

void draw() { double Position = mouseX; double Brightness = (Position/480); if (mousePressed) { led1.write(Brightness); } else { led2.write(Brightness); } }

thank you.

Be the first to answer this question.