Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Wiring Hardware >> Troubleshooting >> wiring board rev004 missbehaiving
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1246997166

Message started by milo on 07/07/09 at 20:06:06

Title: wiring board rev004 missbehaiving
Post by milo on 07/07/09 at 20:06:06
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.

Title: Re: wiring board rev004 missbehaiving
Post by barragan on 07/10/09 at 04:24:10
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?

Title: Re: wiring board rev004 missbehaiving
Post by barragan on 07/22/09 at 06:19:58
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.

Title: Re: wiring board rev004 missbehaiving
Post by milo on 08/16/09 at 02:47:28
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?

:)thanks

Title: Re: wiring board rev004 missbehaiving
Post by barragan on 08/18/09 at 07:36:37
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.

Title: Re: wiring board rev004 missbehaiving
Post by milo on 08/19/09 at 04:25:28
:)

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;
}

Title: Re: wiring board rev004 missbehaiving
Post by Andy on 08/19/09 at 15:29:26
I was also having this problem, the delay has fixed it, thanks!

Title: Re: wiring board rev004 missbehaiving
Post by barragan on 08/20/09 at 01:26:06
great, I think a delay() in the setup() method in processing should work as well, it is worth a try.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.