For some reasons the app of this code does not launch when I export it.

I don't know why when I export this code and run the app, it doesn't launch, but it works fine when I compile it. Anyone knows what's the problem of this one?

import processing.serial.*; Serial port;

 void setup()  {
 port = new Serial(this, Serial.list()[0], 9600);  // Open the port that the Arduino board is connected to, at 9600 baud

}
 void draw() {

  String onoroff[] = loadStrings("C:/xampp/htdocs/DoorlockTest/LEDstate.txt"); // Insert the location of your .txt file
  print(onoroff[0]);  // Prints whatever is in the file ("1" or "0")

  if (onoroff[0].equals("1") == true) {
    println(" - TELLING ARDUINO TO TURN LED ON");
    port.write('H'); // Send "H" over serial to set LED to HIGH


  } else {

    println(" - TELLING ARDUINO TO TURN LED OFF");
    port.write('L');  // Send "L" over serial to set LED to LOW

 }

  delay(1000); // Set your desired interval here, in milliseconds
 }

anyway credits to the programmer of this code.

Tagged:

Answers

Sign In or Register to comment.