Hi!
I've hacked togehter a application to turn on/off a LED (pin 13) on a Arduino Duelmilanove, by sending it serial commands from the host. On the machine i used to develop it on (debian gnu/linux sid) it works great. Moving it to one of my other hosts (i've tried two, both running lenny) the LED only flashes, regardless of what I send. Same client program.
int in;
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT);
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available()) {
in = Serial.read();
if(in) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}
}
This trivial Perl script works on my laptop (sid), but not on lenny:
#!/usr/bin/perl
use Device::SerialPort;
my $port = Device::SerialPort->new("/dev/ttyUSB0");
$port->baudrate(9600);
$port->write("\x1");
I've also tried a simple C program with same results --- working on the laptop, failing on the servers.
Needless to say, I'm really new to this :-), so probably some basic err. Didn't find anything in the troubleshooting documents though.