EDIT: nevermind! I was forgetting to call $serial->write_settings after configuring the port
hello
I programmed my Arduino to send bytes 0 and 128 from time to time
if I unplug the USB, plug it again and run my Perl program (below), it reads sometimes 127, sometimes 0... depending on the byte I send, some other "random" value (28, which is 00011100 and 224, which is 11100000, are some common values)
if, however, I open Arduino program for PC (windows), use the serial communication and THEN run my perl program, it works perfectly until I unplug the USB (then I have to do it again after pluging back)
any ideas on which kind of setting the Arduino program can be running?
I'm currently using, on Perl:
$serial->databits(8);
$serial->baudrate(19200);
$serial->parity("none");
$serial->stopbits(1);
and, on the Arduino program, I only do a Serial.begin(19200), so the other values are all default (which I guess are parity=none, stopbits=1)
any ideas on what may be happening?
since I don't change anything on the Perl program reading from COM7, I'm guessing the Arduino program instructs the Arduino hardware to actually change some configuration on how it was sending data