• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.



Page history last edited by PBworks 12 years, 10 months ago

Bjoern's protocol of setting up Firmata+Processing, 1/3/08:

  • Downloaded the Arduino Library for Processing. This includes the Firmata firmware.
  • Arduino NG can only be programmed with Arduino0010 software, generates error in 0009.
  • To test communication, loaded Processing demo file arduino_input.

    Arduino.list()[n] opens the nth serial port for communication. On my machine, there were three serial ports: COM1,COM2,COM11. COM11 was the FTDI USB Serial port. Hence Arduino.list()[2] is the right initialization command.

  • Standard Firmata software (svn: 334, as included in Processing Arduino library) does not allow the use of pull-up resistors on digital inputs. Two options: we could either modify the test in outputDigitalBytes, line 251, two allow writes to inputs at any time, or replace the force to LOW in setPinMode, line 284 with HIGH, to always turn pull-ups on.  I went for the second choice.
  • For the needs of our class, we have to add servo support to Firmata firmware and Arduino.java. The quick and dirty way is add additional code in main that executes every 20ms and simply blocks while pulsing the servo; since servo pulses are ~ 1.25 to 1.75 milliseconds long (hmm, looks like the HiTec HS-322 takes 0.5-2.5ms pulses), this may be ok - but there is the danger that we'll lose serial input. The cleaner way would be to set up another timer (do we have a spare one?) that causes a software interrupt, which turns the pin back off. Danger here is that we may miss interrupts every once in a while, which leads to twitchy servos. We also need to pick a "MIDI" command for the servo (use 0xA0..0xAF - polyphonic aftertouch - still free), and a proxy function on the Java side (servoWrite(int pin, int value)).
  • Update 1: managed to get a first hacky implementation of servo support in Firmata up and running. There's only one servo supported, and min/max pulse lengths are hardcoded. Here is a zip with the modified firmata firmware, arduino.java library, and example processing sketch: Firmata_Servo_01.zip For the future, we may want to expose the functionality of the Arduino servo library i.e., add attach(), detach() methods, setting of min,max pulse lengths, and multiple servos; or use the Servo Timer 1 library which looks more promising because it uses hardware timers. The latter only supports two servos, but that should be ok for the class.
  • Update 2: incorporated Servo Timer 1. We can now control two servos on pins 9 and 10, and set their min/max pulse times. All files: Firmata_Servo_02.zip


Bjoern's protocol of setting up Firmata+Processing, 1/4/08:

Bjoern's protocol of setting up Firmata+Processing, 1/5/08:


Protocol of getting Arduino+Pd+Pduino up and running with Bill on 5/31/07:


  • First tried Pduino 0.3 (from here) with pd 0.38.2 - got a bunch of "couldn't create ...." messages on opening the arduino-test.pd file
  • Then installed Pd-0.39.2-extended-RC1-windowsxp-i386.exe (from here) and reopened arduino-test.pd: no more errors.
  • I already had the FTDI driver software loaded. Connected the Arduino. To find out which COM port the Arduino uses under Windows, go to Control Panel->System->DeviceManager->COM Ports and look for "USB Serial Port".
  • Next, uploaded arduino firmware from the pduino package - compiling it failed because of a cygwin dll problem. Solution: rename arduinocygwin1.dll to cygwin1.dll.backup and copied cygwinbincygwin1.dll into the arduino directory. (replaced the arduino dll with mine as mine was newer). Then uploaded the firmware to the board (click upload, press reset).
  • in the arduino-test.pd patch, selected the proper COM port by clicking on one of the boxes underneath the "serial port #" comment.
  • enabled analog inputs (make sure check mark ("X") appears in the "which analogIns to enable" fields") and successfully saw sensor data stream in.


Comments (0)

You don't have permission to comment on this page.