Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: Perl Interfacing on: November 30, 2008, 05:34:54 pm
This worked for me -
Arduino USB 2.2 (nkc) and Microsoft Vista
I changed the com port for the Arduino in Vista to Com2
The Diecimila User LED on pin 13 blinks on for 2 seconds when a character is received.

Arduino Code:
void setup() {
   Serial.begin(9600); // open serial
   pinMode(13, OUTPUT);
}
void loop() {
 if( Serial.available()) {
     delay(100);
     char foo = Serial.read();
     delay (2000);
     Serial.println("Got Serial: ");
     Serial.println(foo, BYTE);
     digitalWrite(13, HIGH);
     delay (2000);
     digitalWrite(13, LOW);
 }
}


Perl Code:

# read/write serial port win32
use strict;
use warnings;
$| = 1;
my $count;
my $result;
use Win32::SerialPort;
my $port = Win32::SerialPort->new('COM2');
if( ! defined($port) ) {
        die("Can't open COM2: $^E\n");
}
$port->initialize();
$port->baudrate(9600);
$port->parity('none');
$port->databits(smiley-cool;
$port->stopbits(1);
$port->write_settings();
# send the char "Z"
$count = $port->write("Z");
print "count = $count\n";
# receive
($count, $result) = $port->read(15);
print "count = $count\n";
print "$result\n";
$port->close();
exit(0);

I run the perl code in an Administrator window to bypass UAC on Vista.
(addendum) The above works great until you take the power off the Arduino by unplugging the USB cable.  When you plug it back up, the perl shows sending a character, but returns 0 (no echo).   Using the Putty serial terminal program the Arduino code works properly.  The Arduino code also works properly with the serial monitor in the Arduino editor.  What is different about accessing the serial port with perl from the command line?
2  Forum 2005-2010 (read only) / Interfacing / Re: ps/2 keyboard problem... on: November 05, 2008, 07:16:28 pm
I'd take the suggestion about a USB-PS/2 adapter another way.  It is a good source of a PS/2 socket that doesn't involve disassembling a motherboard.  You could disassemble the adapter just to get the socket, or cut the end off a USB extender cable and use the wires to go to the pins on the Arduino.
I agree, the USB connector on the Arduino could NOT be used without looking into the USB-HID information mentioned above. smiley
3  Forum 2005-2010 (read only) / News / Re: Arduino 0013 released. on: February 07, 2009, 12:07:46 am
Is it possible the avrdude.conf in the 0013 Linux package has not been upgraded to include the Atmega328p?  I get avrdude errors when I try to use it.  I'm using Ubuntu Intrepid.
Update - I checked the avrdude.conf in arduino-0013/hardware/tools and it doesn't have a m328p section.  the same file in the windows package does have it.  I got my system to work by replacing avrdude.conf with the one from the Windows package.
My system had copies of avrdude.conf in /etc; in the arduino-0013 directory set; and in /usr/local/etc, so I had to make sure all of the them were replaced, since I wasn't sure which one was being used.
4  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Windows 7 Beta on: January 15, 2009, 09:02:16 am
The first time I tried to compile a sketch, the status windows gave a number of java error messages.  I closed the program and re-launched it.  This time I was able to compile and load the sketch to the arduino.  The serial monitor seems to work, also.
One anomaly is that the serial port that Seven assigned to the arduino was 4.  I've had 1,2,3,23,24 under Vista, but 4 is a new one.
5  Forum 2005-2010 (read only) / Frequently-Asked Questions / Windows 7 Beta on: January 15, 2009, 08:50:46 am
Arduino 12 ran okay in Vista using "Run as administrator".
In Windows 7 Beta Build 7000, that wasn't enough.  The troubleshooter added an option "Vista Compatability Mode" and the program launched.  The Beta sent a troubleshooting/problem message to Microsoft.
Another report after I'm able to communicate with the Arduino.
Pages: [1]