radarboy
Junior Member
Offline
Posts: 53
Serial Speed
Jul 25th , 2005, 7:10am
Hi i'm trying to communicate to a Basic Stamp, and am having a number of issues in relation to speed. not sure if this is the right place to post this, or if it should be in the syntax discussion. Data is taking more than a second to send - causing my LEDs to have a very slow refresh rate. I am only sending 48 numbers, so this seems pretty slow. One issue is the delay(2) that i need to put in, if i don't, that data comes out wrong on the other side, even with using handshaking. If i don't use handshaking, then i need to increase the delay even more. Also, what is the maximum Baud that the Serial library can handle. I have tried using a number of different baud rates, tried 50 000, but it won't work in Processing. Here's the code, is there anyway to speed this up, or are there any other issues regarding serial i'm not aware of : void writeSerial(){ row++; if (row>7){ row=0; } if (row<0){ row=0; } for (matrix=5;matrix>-1;matrix--){ // println (matrix+"/"+row); delay(2); output = unbinary(picData[matrix][row]); print (picData[matrix][row]); myPort.write("*"); myPort.write(output); } } void draw() { background(0); while (myPort.available() > 0) { dd=myPort.read(); if (dd == 53){ writeSerial(); print(dd+"."); dd=0; } } } ////////////////////////////////// A bit about my project: The pice consists of a phyicals installation of 6 LED screens, driven by Basic Stamps, connected via serial to Processing, as well as a number of webcams. Each screen features a tamagotchi-like animal, which users can interact with, via SMS. The webcams are used to track motion and send live webcam shots to the website. The graphical display part takes image data and converts it to binary, which then sends to the BS to turn on and off the LEDs. However, the ability of the screens to refresh fast enough, will make the diffrence between an ok installation and a great one. But I'm seriously running out time, so any advice would be apreciated. I am exhibiting in 2 weeks time, at the Stills Gallery, dring the Edinburgh Festival.