Difference between revisions of "Arduino ledOn-1"

From dftwiki3
Jump to: navigation, search
 
Line 17: Line 17:
  
 
</pre></code>
 
</pre></code>
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC231]][[Category:Arduino]]

Latest revision as of 18:29, 8 October 2010

Make sure to change the UNIT1 variable to reflect the correct tty...

#!/bin/bash -e
# by Roland Latour, Feb.2008, GPLv2, see 'man gpl'

#UNIT1=/dev/tty.usbserial-A6004osu
UNIT1=/dev/ttyUSB0
if [ -e $UNIT1 ]; then
# send the command
   /bin/echo -e -n "w d 13 1\n" > $UNIT1
else
   /bin/echo "Unit 1 not plugged in."
fi

# set up similar aliases for the other IO pins, when you name those pins