Coding problem for PhysicalPixel example (Arduino)/ simpleWrite(Processing)

edited March 2014 in Arduino

So recently I tried running the PhysicalPixel example on the Arduino, But there seems to be a problem with the output.

When I run the program via processing, the LED on my Arduino Mega 2560 lights up immediately, which is not supposed to happpen until I move my mouse cursor over the highlighted box. It stays on as long as the sketch is running.

However, deleting the : port.write('L') seems to make it work halfway. The LED doesn't light up when mouse cursor isn't above the highlighted box, and does light up when over the box, but it doesn't turn off when I move my cursor away from the box.

Does anyone have a clue what i'm doing wrong?

Answers

  • edited March 2014 Answer ✓

    for Mega: delay 2 seconds in the setup

     port = new Serial(this, Serial.list()[0], 9600);
    delay (2000);
    
  • Thanks alot, it works! Also, would you mind explaining? I don't seem to understand why the 2 seconds?

    How about 1 second?

  • "How about 1 second?"
    Just try?
    It looks like experimental finding, anyway.

  • well I did eventually try, and it failed. Seems like a 2 second delay is a must.

    Still haven't found the time to figure out why it has to be 2 seconds though.

Sign In or Register to comment.