Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-linux] Interfacing Aduino board to NSLU2-slug running debian linux

Expand Messages
  • Eric Varsanyi
    You could try to narrow down which facility on the Arduino is acting differently than in the IDE by commenting out the part that checks for a serial character
    Message 1 of 2 , Jul 5 10:29 AM
    • 0 Attachment
      You could try to narrow down which facility on the Arduino is acting differently than in the IDE by commenting out the part that checks for a serial character and just have it blink the LED continuously... if the LED doesn't blink there may be some mapping issue between pins in the IDE and the board you are using (I don't know anything but what I just read on Wikipedia about the Arduino), if it does blink then you may have a serial problem. You could also look at the serial output and see if your 'I received:' messages are coming out, if they are its likely there's an issue with the LED output rather than the serial side.

      -Eric

      On Jul 4, 2008, at 5:09 PM, johncohn wrote:



      Friends, 

      I'm trying to interface an Arduino decimilla to an NSLU2 running Debian
      linux. I want to blink a light every time I get a serial character on the
      USB link to the arduino Here's the code I'm running on the arduino 

      /* based on Arduino WebVisitors Blinker by Dimme.net */

      int ledPin = 13;
      int val = 0;

      void setup() {
      Serial.begin( 115200);
      pinMode(ledPin, OUTPUT);
      }

      void loop () {

      if (Serial.available( ) > 0) {
      // read the incoming byte:
      int incomingByte = Serial.read( );

      // say what you got:
      Serial.print( "I received: ");
      Serial.println( incomingByte, DEC);
      for(int i=0; i<10; i++) {
      digitalWrite( ledPin,HIGH) ;
      delay(150);
      digitalWrite( ledPin, LOW);
      delay(150);
      }
      }

      }

      This works perfectly in the Arduino IDE.. Ie. I can compile and upload, then
      go to the serial terminal, send a character and the main LED blinks as
      designed...

      When I hook the arduino up to the NSLU2 the trouble starts.. I am trying to
      send a simple char to the
      arduino by doing

      echo 1 > /dev/ttyUSB0

      the communications lights on the arduino flicker... so I know i'm sending
      something.. . but the main LED does not blink.. 

      I'm trying to emulate what is suggested in
      http://dimme. net/2008/ 01/10/webvisitor s-blinker/ ( I tried the above echo
      from php as in this article.. same results as above) 

      I've also tried a variety of options on the echo including 'echo -n' 
      sending newlines, etc.. but still no luck .

      In desperation, I hooked the same arduino board with the above code to a
      desktop system running ubuntu and had the same results (ie; blinking
      communications lights, but no blinking main LED) when I typed

      echo 1 > /dev/ttyUSB0 

      The fact that I get this same behavior on the NSLU2 running Debian and the
      Desktop running Ubuntu seems to mean that it's probably not anything unique
      in the NSLU2 setup that's preventing the arduino from seeing the input. 

      I'm suspecting a data rate problem or something like that .. I've
      experimented with the stty options as suggested here
      http://www.arduino. cc/playground/ Interfacing/ LinuxTTY but that also doesn't
      work..

      Any ideas ?

      Has anyone gotten an Arduino to talk to an NSLU2 ? If so.. please let me
      know how you did it..

      Thanks !
      -jc 
      -- 
      View this message in context: http://www.nabble. com/Interfacing- -Aduino-board- to-NSLU2- slug-running- debian-linux- tp18286790p18286 790.html
      Sent from the Nslu2 - Linux mailing list archive at Nabble.com.


    Your message has been successfully submitted and would be delivered to recipients shortly.