Difference between revisions of "CSC231 Connecting the Arduino to a Mac"

From dftwiki3
Jump to: navigation, search
(New page: ==Arduino / Mac == --~~~~ * get the Arduino development system ([http://www.arduino.cc/ www.arduino.cc/]) and install it on your Mac (on the Desktop, for example) following the directions...)
 
(Arduino / Mac)
 
Line 27: Line 27:
  
 
I am giving up on writing an assembly program that talks to the Arduino and that runs on the Mac.  The BSD-style of system calls is so poorly documented, that writing a string to the Arduino from an assembly program is just impossible at this point :-(
 
I am giving up on writing an assembly program that talks to the Arduino and that runs on the Mac.  The BSD-style of system calls is so poorly documented, that writing a string to the Arduino from an assembly program is just impossible at this point :-(
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC231]][[Category:Arduino]]

Latest revision as of 18:30, 8 October 2010

Arduino / Mac

--D. Thiebaut 18:48, 31 October 2008 (UTC)

  • get the Arduino development system (www.arduino.cc/) and install it on your Mac (on the Desktop, for example) following the directions.
  • Make sure to install the USB drivers.
  • Record the name of the USB driver. You can get it by opening a Terminal and typing
 ls /dev  | grep tty | grep usb

which yields for me:

 tty.usbserial-A6004osu
  • Load the blink example from the example sketchbook (in the digital section). You will have to set the type of board and the type of driver needed.
  • Compile and upload your program. Verify that the LED blinks
  • Get the Simple Message System [1] and follow the directions to install it as a library in the Arduino library folder (on my system, the library path is ~/Desktop/ARDUINO/arduino-0011/hardware/libraries).
  • Load the SimpleMessageSystem_Example_1 program, compile it, and upload it to the Arduino.
  • Open the Serial Monitor. For some reason, failure to open the serial monitor will prevent the test from working...
  • Open a new Terminal window and type the following commands, one after the other:
 echo -e -n "w d 13 1 \r" > /dev/tty.usbserial-A6004osu 
 echo -e -n "w d 13 0 \r" > /dev/tty.usbserial-A6004osu 
(Make sure you replace /dev/tty.usbserial-A6004osu by the name of your USB driver)
The commands instruct the Mac to echo the string "w d 13 1 \r" to the device with driver /dev/tty.usbserial-A6004osu. w means write, d means to a digital pin, 13 means Pin 13, and 1 means the value 1. Digital Pin 13 is connected to an LED on the board, so writing 1 or 0 will turn the LED On and Off.

I am giving up on writing an assembly program that talks to the Arduino and that runs on the Mac. The BSD-style of system calls is so poorly documented, that writing a string to the Arduino from an assembly program is just impossible at this point :-(