Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumWiring HardwareTroubleshooting › wiring board rev004 missbehaiving

Page Index Toggle Pages: 1
wiring board rev004 missbehaiving (Read 7341 times)
07/07/09 at 20:06:06

milo   Offline
YaBB Newbies

Posts: 3
*
 
Hi,

i'm using a wiring board rev 0004
and i am trying to connect wiring with processign following the examples in the learing page : http://www.wiring.org.co/learning/examples/serial_input.html
i know the serial port is working properly and processing can comunicate with the board because this example : http://www.wiring.org.co/learning/examples/serial_output.html
works with the board.
So, the issue seems to be the comunication from processing to the board.
I really don't know what I'm doing wrong.

thanks for the help you can provide me.
 
IP Logged
 
Reply #1 - 07/10/09 at 04:24:10

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
I'll get a board tomorrow to test, the only difference for revision 0004 is the auto-reset feature, clearly the board is capable of send and receive data since you can upload a new program. Which Wiring version are you using? and Processing version? platform?
 
IP Logged
 
Reply #2 - 07/22/09 at 06:19:58

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Ok, I am running tests here and things seem fine. Every time processing opens the serial port where the Wiring board revision 0004 is connected (1 in my case) the board is reset and restart again transmitting data back to processing and from processing.
 
IP Logged
 
Reply #3 - 08/16/09 at 02:47:28

milo   Offline
YaBB Newbies

Posts: 3
*
 
de vuelta a clases...
i tested today my board.

barragan wrote on 07/10/09 at 04:24:10:
...clearly the board is capable of send and receive data since you can upload a new program. Which Wiring version are you using? and Processing version? platform?


yes, but the odd thing happens when i run processing with the write to serial port code, the LED named RX in the wiring board start to blink (at the baud rate i guess), but nothing else happens

other than that the board works perfectly, every other example has worked, but those involving data incoming from processing like making a led blink (in the board) when the mouse is over the grey square (in processing), just dont work.

The wiring IDE reports that everything was uploaded successfully.
and processing is opening the port correctly, and sending the
data. but, again the RX leds blinks but the on-board LED 48 doesn't

Right now i am testing in a fedora 11 (with no errors)
with processing 1.06
and the latest wiring
also i have checked my code using a windowsXP sp2
on the same machine
and also i have checked the board using a mac, but i get the
same behaviour.
Is there other way i can test the the serial port with out using processing, just to figure out if the problem is the code, the board, or processing?

Smileythanks
 
IP Logged
 
Reply #4 - 08/18/09 at 07:36:37

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
we found the issue, once Processing opens the serial port where the board is connected, the board is reset. If you start transmitting data to the board immediately the board will interpret this as if you were uplaoding a new program. The solution is to wait at least a couple of seconds right after opening the serial port in processing before sending data to Wiring. Let me know.
 
IP Logged
 
Reply #5 - 08/19/09 at 04:25:28

milo   Offline
YaBB Newbies

Posts: 3
*
 
Smiley

yey, it's working now, i'm using a delay in my processing code, and it works.
Thanks!

Code:
the code:
import processing.serial.*;

Serial myPort;
int val;	  
int delayTime=5000;
void setup()
{
  size(200, 200, P3D);//p3d, para que compiz no se estrelle
  String portName = Serial.list()[0];
  myPort = new Serial(this, portName, 115200);
}

void draw() {
  
  delay(delayTime);
  background(255);
  if (mouseOverRect() == true) {  
    fill(204);			  
    myPort.write('H');
  }
  else {			    
    fill(0);			  
   myPort.write('L');
  }
  rect(50, 50, 100, 100);

}//end draw

boolean mouseOverRect() {
  return ((mouseX >= 50) && (mouseX <= 150) && (mouseY >= 50) && (mouseY <= 150));
}

void keyPressed() {
  delayTime=0;
}
 

 
IP Logged
 
Reply #6 - 08/19/09 at 15:29:26

Andy   Offline
YaBB Newbies
Terre Haute, Indiana

Posts: 45
*
 
I was also having this problem, the delay has fixed it, thanks!
 
IP Logged
 
Reply #7 - 08/20/09 at 01:26:06

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
great, I think a delay() in the setup() method in processing should work as well, it is worth a try.
 
IP Logged
 
Page Index Toggle Pages: 1