send data from processing to arduino
in
Integration and Hardware
•
6 months ago
any one can help me my arduino can't read my value the program is extractind data from a game and show it in small bow after i want to transfer it to arduino
this is the program
-
import processing.serial.*;import jaron.flightgear.*;import jaron.gui.*;import jaron.pde.*;
// The TEST components that are used by this applicationDisplay display;FlightGearReceiver receiver;Serial port;// The PDE setup method that is called once at startupvoid setup() {String portName = Serial.list()[0];// initialize our serial object with this port// and the baud rate of 9600port = new Serial(this, portName, 9600);// Setup the PDE environmentsize(170, 170);background(Colors.GRAY_WINDOW);frameRate(30);smooth();
// Setup TEST componentsreceiver = new FlightGearReceiver();display = new Display(this, 10, 10);// Connect the display to the FlightGear receiverreceiver.addSignalListener(FlightGearReceiver.kRollRate, display.createTextLine("Roll rate"));receiver.addSignalListener(FlightGearReceiver.kPitchRate, display.createTextLine("Pitch rate"));receiver.addSignalListener(FlightGearReceiver.kYawRate, display.createTextLine("Yaw rate"));receiver.addSignalListener(FlightGearReceiver.kAirSpeed, display.createTextLine("Airspeed"));receiver.addSignalListener(FlightGearReceiver.kPitch, display.createTextLine("Pitch"));receiver.addSignalListener(FlightGearReceiver.kRoll, display.createTextLine("Roll"));}
void draw() {String j1 = FlightGearReceiver.kRollRate ;String j2 =FlightGearReceiver.kPitchRate;String j3 =FlightGearReceiver.kYawRate;String j4 =FlightGearReceiver.kAirSpeed;String j5 =FlightGearReceiver.kPitch;String j6 =FlightGearReceiver.kRoll ;
port.write("j1");port.write("j2");port.write("j3");port.write("j4");port.write("j5");port.write("j6");display.draw();}
// Destroy is called on application exitvoid destroy() {receiver.setDebug(true);receiver.shutDown();}
1