Pages: [1]   Go Down
Author Topic: Monitoring USB Output via Linux Terminal (w/ IR)  (Read 842 times)
0 Members and 1 Guest are viewing this topic.
Madison, WI
Offline Offline
Newbie
*
Karma: 0
Posts: 25
No loafing.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey all, many of you may be very well aware how to do this, but it took me about 45 minutes to track this information down, hopefully this can help someone smiley

I have been developing an IR TX/RX system using two Arduinos and none of the solutions on this forum quite work for what I want to accomplish.  Hopefully, I can get this done in the next week or so as I have time.

Anyways, here's what I have and maybe it can help someone not waste as much time as I did!

I guess I'll start with the code/setup (included in the code).

Code:
/* Works with IR breakout board from Sparkfun.com
   Sparkfun P/N SEN-08554, it utilizes the Vishay TSOP85
   Pin Out:
   Vcc = Arduino 5V
   Out = Arduino D2 (Interupt 0)
   Gnd = Arduino Gnd                                    */

int interuptPin = 2;
int IRPin = LOW;

void setup()
{
  pinMode(13, OUTPUT);  //For Debugging
  attachInterrupt(0, IRStateChange, CHANGE);
  Serial.begin(9600);  //For Debugging
}

void loop()
{
  digitalWrite(13, LOW);
}

void IRStateChange()
{
  IRPin = digitalRead(interuptPin);
  digitalWrite(13, HIGH);
  Serial.print(IRPin);
}

On a windows system with this program loaded and monitoring the serial port, you can point a remote at it and get a stream of 1's and 0's.  This was tested with a Philips Universal remote and a Charter Cable universal remote.

On linux it is a little more tricky, but not much.  Connect your arduino to the USB and make sure you get something along the lines of:
Code:
usb4-2 blah blah blah
...
usb4-2: FTDI USB Serial Device converter now attached to ttyUSB0

On Fedora Core 12 and with an old cruddy computer I didn't have to install any drivers and it was automatic.

Then, simply use the command:
Code:
screen /dev/ttyUSB0 9600

That is it and obviously ttyUSB# depends on what the OS reports your USB port # as.

(google screen commands for help with screen as I am not allowed to post the link because this is my first post!)

Hopefully some part of this post helped for some reason for someone smiley

-Tweed

EDIT: If you find yourself in trouble with any USB device in Linux, it is always a good idea to unplug it and sift through the ashes.
« Last Edit: October 26, 2010, 08:22:11 pm by tweedius » Logged

Pages: [1]   Go Up
Jump to: