Pages: [1]   Go Down
Author Topic: Project 14 (Tweak the Arduino Logo)  (Read 8140 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

I have downloaded the last version of processing (2.0b7), but executing the processing code I receive the "serial does not run in 64-bit mode" (I use Windows 7 x64), any solution?

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I had the same. but are now using the 32 bit version. works well...
I needed to copy paste the code though.

cheers, Sander
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I've another problem with project 14. The color sometimes changes very slowly or somtimes it doesn't change at all. It's the same with the numbers in the black field in processing.  I've look at the poti's values at a arduino programm and it works. They change very fast.  I think the code is right because I've tested it with the from the arduino software, too. There's the same problem.
Can anyone help me?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

posted by tiffi:
Quote
Hello,
I've another problem with project 14. The color sometimes changes very slowly or somtimes it doesn't change at all. It's the same with the numbers in the black field in processing.  I've look at the poti's values at a arduino programm and it works. They change very fast.  I think the code is right because I've tested it with the from the arduino software, too. There's the same problem.
Can anyone help me?

I have the exact same issue!  I've actually installed Processing and Arduino on both my Windows 7 laptop and my Macbook Air running Mountain Lion and I have the same issue on both (exactly as described above by the previous poster).  On the Windows machine I've installed the 32-bit version and on the Mac I've selected the 32-bit option in preferences.

Does anyone have an explanation or a fix?

Thanks,

Jeff
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 31
Posts: 640
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have downloaded the last version of processing (2.0b7), but executing the processing code I receive the "serial does not run in 64-bit mode" (I use Windows 7 x64), any solution?


This is from the Processing site:
Quote
I know this is an issue.

We all very much want a 64-bit serial library.

I don't have time to make and test one across all the necessary platforms.

We hope that someone will soon.

It is marked as an “enhancement” because we have never had a 64-bit library. Calling it a major bug won't change the fact that I don't have time to fix it right now.

For the time being, comment #5 explains a workaround.

"comment #5: On Linux and Windows, download the 32-bit version of Processing. "

Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 31
Posts: 640
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As for the color changing rate problems you are seeing, it appears to be a serial buffering issue.  The Arduino is sending reading sample updates too fast for Processing to keep up with.  I don't know why they made the Arduino code sample that fast (1 millisecond delay is about 1000 samples per second), it's not really necessary.

But here is a quick fix workaround to this.  Change the sample delay from 1 millisecond to 100 milliseconds.  This should slow down the Arduino sampling slow enough for Processing to keep up with.

Try this:
Code:
void loop() {
  // read the value of A0, divide by 4 and
  // send it as a byte over the serial connection
  Serial.write(analogRead(A0)/4);
  delay(100);
}


Logged

UK
Offline Offline
Jr. Member
**
Karma: 1
Posts: 62
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Hiduino.

I'm on lowly project 7 but already have this on all the sketches. There's one,for example (I forget which) that shows 2 lines of values and it's impossible to read them unless you slow it all down. Worked for me. Would recommend it for v2.
Logged

Photography nut trying to make the flux capacitor of macro pho

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

I downloaded the 32-bit version but I still can't compile. I get the same error that I got on the 64-bit version,

"serial is only compatibl wit the 32-bit download of Processing."

.

Someone pls help!
Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 31
Posts: 640
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

I downloaded the 32-bit version but I still can't compile. I get the same error that I got on the 64-bit version,

"serial is only compatibl wit the 32-bit download of Processing."

.

Someone pls help!

Which Arduino are you trying this with?

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

EDIT**
I restarted my PC n no it work's just as intended.
« Last Edit: June 27, 2013, 06:54:47 am by sina92 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've run into some trouble on this project again.

I can change the background color but it keep's flashing. I think it's because of my port.read() values. They pretty much always bounce between 55 and 10, hardly taking notice of how much I've turned the potentiometer.

I have no experience dealing with serial communication, so I'm a bit lost at the moment.

My code:

Code:
import processing.serial.*;
Serial myPort;

PImage logo;

int bgcolor = 0;

void setup() {

  colorMode(HSB, 255);

  logo = loadImage("http://www.userlogos.org/files/logos/jumpordie/teamliquid-iphone.png");
  size(logo.width, logo.height);

  println("Avilable serial ports");
  println(Serial.list());

  myPort = new Serial(this, Serial.list()[1], 9600); // parameters : which application, which port & what speed
}

void draw() {
  if (myPort.available() > 0) { // if(there is something in the buffer)
    bgcolor = myPort.read();
    print("     ");
    println(myPort.read());
    println(bgcolor);
  }

  background(bgcolor, 255, 255); // hue, brightness, saturation. max value 255
  image(logo, 0, 0); // image() is used to draw. --- what to draw , x-coordiante to start, y-coordiante to start ---
}

1. Does anyone know what I should do in order to get proper readings?

2. What type of images can I use? Any image, or does it have to be a .jpg, .png etc...?

Thanks in advance!!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As for the color changing rate problems you are seeing, it appears to be a serial buffering issue.  The Arduino is sending reading sample updates too fast for Processing to keep up with.  I don't know why they made the Arduino code sample that fast (1 millisecond delay is about 1000 samples per second), it's not really necessary.

But here is a quick fix workaround to this.  Change the sample delay from 1 millisecond to 100 milliseconds.  This should slow down the Arduino sampling slow enough for Processing to keep up with.

Try this:
Code:
void loop() {
  // read the value of A0, divide by 4 and
  // send it as a byte over the serial connection
  Serial.write(analogRead(A0)/4);
  delay(100);
}


There is a way to fix this issue changing only the Processing code to clear the buffer after reading a byte:

Code:
if ( myPort.available() > 0) {
 // read the value and store it in a variable
 bgcolor = myPort.read();
 myPort.clear();
 
 // print the value to the status window
 println(bgcolor);
}
Logged

Pages: [1]   Go Up
Jump to: