We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Basic Stamp (Read 3132 times)
Basic Stamp
May 28th, 2005, 12:44pm
 
How would one use processing to say flash an LED on a Basic Stamp. Got as far as getting Processing to see my serial port etc. but can't seem to work out how to talk to it properly....
eg. do a simple thing like press key, turn on LED...
Also i keep getting Var spool lock errors:
RXTX Warning:  Removing stale lock file. /var/spool/uucp/LK.001.009.002
RXTX Warning:  Removing stale lock file. /var/spool/uucp/LK.001.009.002
Not really serious, just annoying. If i remove the file, then it works, but seems to always reoccur.
tx
Re: Basic Stamp
Reply #1 - May 29th, 2005, 4:22pm
 
OK, worked it out.
For anyone who is interested:


PBASIC CODE:
- Modified from James Matthews' code (http://www.generation5.org)

led1 CON 3      ' The first LED
progPin CON 16  ' The programming pin
ledCmd VAR BYTE
LOW led1

ReceiveLoop:
SERIN progPin, 84, [ledCmd] ' Get the serial data
IF ledCmd = 48 THEN ledon
IF ledCmd = 49 THEN ledoff
GOTO ReceiveLoop

ledon:
HIGH led1
GOTO ReceiveLoop

ledoff:
LOW  led1
GOTO ReceiveLoop

PROCESSING CODE:
import processing.serial.*;
Serial myPort;

void setup() {
background(255,0,0);
myPort = new Serial(this, Serial.list()[5], 9600);
}

void draw() {
if (mousePressed){
myPort.write(49);
 background(0);
 }
 else
 {
  myPort.write(48);
 background(0);
 background(255);
 }

}

Re: Basic Stamp
Reply #2 - Aug 2nd, 2005, 5:59pm
 
hi there,
just quick one, but did you manage to find a way of automatically deleting those files:

/var/spool/uucp/LK.001.009.008

i have the same probs and have to delete them manually

kind regards

Boppyer:-)
Re: Basic Stamp
Reply #3 - Aug 2nd, 2005, 6:31pm
 
have you read tom's instructions about re-installing serial after installing tiger?
http://processing.org/faq/bugs.html#serial

and please don't cross-post.
Re: Basic Stamp
Reply #4 - Aug 2nd, 2005, 7:00pm
 
I did yes, and it didn't resolve the problem, sorry for cross posting but it was the same bug as the orginal post Sad
Page Index Toggle Pages: 1