Arduino Related Resources
Stephen Wilson,
Professor, Art, SFSU, Conceptual
Information Arts Program
Arduino is an international project to develop open source hardware
microcontroller and computer interface devices. The project is
being worked on by hardware hackers, coders, and artists around the
world. Hardware designs and code are freely shared with the
community. Below are some resources that might be of interest to
people exploring the Arduino board and context.
Wilson Genereal Serial Control
wilson.serialio.ver43.txt
-- This is code that can be loaded into the Arduino board
-- You would need to be in the arduino authoring environment and
paste it in
-- and then upload to the arduino board
-- ** note the previous
serial io
version posted here had one minor error that prevented it from reading
digital input #2. 41 fixed this
Also there was a problem that there was long delay at end of
routine. This made the routine not very responsive when talking
to media program. This new version (42) corrects that problem.
----
Version (42) had minor error with the capitalization and . in the
middle on Serial.available()
version 43 fixes that
---
* General Purpose computer serial IO
* copyleft Stephen Wilson http://userwww.sfsu.edu/~swilson/
* Created October, 2006, modified 4/07
* The code activates most arduino functions
* (digital in, digital out, analog in, analog out)
* by sending ascii strings via serial communication
* It can be used by any program that can send & receive
strings.
* Documentation is included with the code
Example of using the Wilson general serial routine with Director:
- Copy the Arduino code from wilson.serialio.ver43.txt and paste it into your
Arduino
sketch
window.
- Compile it and upload to your Arduino board.
- Get a copy of Serial
Xtra by Geoff Smith (people in SFSU couse contact the
professor) and place it in the Xtras folder located in your
Director folder.
- Get a copy of Steve Wilson's Template (Wilson.arduinotemp13.dir
) program - it contains
examples of the routines in Director that allow it to talk to the
Arduino board - sending and receiving commands and information.
- Plug in the Arduino board
- Start Director and load the template program. Do not run it
yet. Go to the main movie level script. Find the handler
called
'on startsensors'. In it
you will find the line that tells
Director what the address of your usb connection is. You must determine
that address. It varies by computer and also by usb phyiscal plug
location.
- Go to the Message window and issue this command 'put findports()' -
Serial Xtra will see what ports it knows about and report the address
for the
usb ports. It will look something like this - /dev/cu.usbserial-1B1
- Copy that address and replace the address that is in the sample
director code in the port=
line
- Run the Director program and go to the debugging section -
it will show how to use most features.
- Director will need to prepare Strings to send to the arduino for
digital and analog out
- Director will need to extract the data from the strings that come
into director from arduino for digital and analog in.
- Those without a lot of director experience are welcome to build
their own Director movies on top of the template. Please
attribute source.
Wilson.Arduino.Com.Dir.txt
(text version - paste into director movie level script window)
wilson.arduinotemp14.dir.zip
(Macintosh zip version)
(A simple Director/Lingo program that demonstrates communication with
Arduino. It relies on you having the serialXtra plugin and the
Wilson.GeneralSerialIOControl loaded into Arduino)
**note this version adds demos and
fixes minor problems in the the previous version 13 posted here:
- The digin routine could never read digital in #2. Therefore
every reference to digital in #2 would not work. Now the
wilson.serialio.ver41.txt described above has fixed that problem
- In the movie position section of Movie Control demo the script
refers to word 2 of line 1 of field anin as analog in #1 - it is really
analog in #0 (the field with the analogin values starts with
analog 0 on line 1, analog 1 on line 2 etc.)
- In the movie start section of Movie Control demo the script
refers to word 2 of line 3 for digital in #3. It should really be
line 2. (the field with the digitalin values starts with digital
2 on line 1, digital 3 on line 2 etc.)
- In the Button Demo the act on dig button script had an
error. It sadi it was doing digital in by getting word 2 of line
3. Really it had to get word 2 of line 2 not line 3 (the field
with the digitalin values starts with digital 2 on line 1, digital 3 on
line 2 etc.)