Anna Kaziunas France
contact / connect
  • ABOUT
  • PUBLICATIONS
  • PROJECTS
  • EXPERIMENTATION LOG
  • UX
  • RÉSUMÉ
  • FAB ACADEMY TUTORIALS
Current Projects  //  Expermentation Log
Posts Tagged ‘tutorials’

Pure Data to Arduino Over Serial

Posted in Fab Academy AS220 - Providence, RI, Fab Academy Providence -Year II - Teaching on May 4th, 2011 by Anna Kaziunas France – Be the first to comment

For Fab Academy, Shawn Wallace put together a basic example of getting the Arduino to make music using Pure Data.

  • First, get the extended version of Pure Data here:  http://puredata.info/community/projects/software/pd-extended
  • NOTE: You need the exended version with the comport object, used to talk to the serial port.
  • Next, flash your Arduino with the following code:
void setup() {
 Serial.begin(9600);
}

void loop() {
 for (int i=0; i<255; i++) {
 Serial.write(i);
 delay(100);
 }
 for (int i=255; i>0; i--) {
 Serial.write(i);
 delay(100);
 }
}

pde

  • Then, save this Pure Data patch to a text file, name it SimpleExample.pd, and open it up in Pure Data:
#N canvas 644 73 523 614 10;
#X obj 186 309 dac~;
#X obj 110 182 r left;
#X obj 298 180 r right;
#X obj 36 150 osc~;
#X obj 80 151 osc~;
#X obj 39 194 *~ 0.2;
#X obj 235 181 *~ 0.2;
#X obj 266 227 *~ 1;
#X obj 90 226 *~ 1;
#X obj 35 47 comport 9600;
#X msg 36 17 devices;
#X msg 95 19 open 2;
#X floatatom 35 70 5 0 0 0 - - -;
#X obj 35 102 * 10;
#X obj 75 103 * 20;
#X connect 1 0 8 1;
#X connect 2 0 7 1;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 8 0;
#X connect 6 0 7 0;
#X connect 7 0 0 1;
#X connect 8 0 0 0;
#X connect 9 0 12 0;
#X connect 10 0 9 0;
#X connect 11 0 9 0;
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 13 0 3 0;
#X connect 14 0 4 0;

A nice feature of Pd is that all the patches are in a simple text format.

To Get this Example Working:

  • Open Pure Data
  • Open the “SimpleExample.pd” file in Pure Data
  • Click on the “devices” message box: This will list any available serial ports in a numbered list.
  • On my Mac, the usb port connected to the microcontroller was on port 2; (it may be different on your computer)
  • Find the correct port number and change the “open” message from “open 2” to “open (your port # here)”. To do that, enter Edit mode under the Edit menu. Now you can type directly into the message boxes. After you change the “open” message, leave edit mode and do the following:
  • 1. Select “compute audio” in the main Pd window
  • 2. Click on the “open” message to open the serial connection

pd

You should see output of the comport changing, and should hear a rising and falling tone.

Board in Action – Shown with “Fabbed Arduino” Board”

  • Subscribe: Entries | Comments
  • recent posts

    • How to Make Hoof Shoes
    • Navy Wool Crepe Vest
    • Copper Tencel and Navy Thread Lace Infinity Scarf
    • Machine-Knit Multi-lace Infinity Scarf
    • Return of the White Chocolate Skulls, Isis Costume
    • 3D CNC Studies: “All Ears” + “I Am Providence”
    • Getting Started with MakerBot – now in Print!
    • Self-Portrait as Kali
    • White Chocolate Skulls in PLA Trays
    • A Very Kali Halloween
    • Switch to HBP from ABP
    • Thing-o-matic Operational – First Prints
    • Thing-o-matic Problems / Solutions – Machine stops after homing, ABP won’t heat
    • Makerbot Thing-o-matic Build
    • Finished Decorative Side Table
    • MakerBot Thing-o-matic Pre-Assembly Prep – Staining with Watco Danish Oil
    • My MakerBot Arrives
    • Halloween 2011 – Glowing LED Oni Costume
    • Kipp Bradford unveils his open-source, hackable 2000BTU cooling systems at AS220 Labs
    • 3D Print of Spikes
    • WWII Pilot Cast
    • Tools Relief – Cast Attempt 2 – Success!
    • Tools Relief – Cast Attempt 1 – Failure
    • Heart of (hydro)Stone
    • How to Update the Fab Modules for Serial Devices / Modela Milling Machine
    • AS220 Labs / Fab Academy Sign – Metal Etching / Cutting Tests on the Shopbot
    • Fab Lab Haystack Projects – From Haystack Students – 2011 Session 3 – Week 1
    • Decorative Side Table – First Shopbot / Furniture Project
    • Making LED Dragon Night Kites with Jie Qi
    • Fab Lab Haystack Projects – From Haystack Students – 2011 Session 2 – Week 2
    • Old School Fab Academy Providence Polaroid Portrait: From the Days When Cameras Were Furniture
    • MTM Snap Shield
    • Laser-Cut Copper Foil Graduation Cards
    • FabRC – Fab Academy Final Project Progress
    • FabRC – Project Developments
    • FabRC – Final Project Planning
    • Working MTM Snap – Almost Complete!
    • Hello Serial Bus
    • Fab Academy AS220 Assembles the MTM Snap
    • Pure Data to Arduino Over Serial
    • Hello (Make Your Own) Arduino
    • Hello Stepper Motor
    • Hello RGB
    • Hello LED Matrix
    • Hello Phototransistor
    • Hello Microphone
    • FabKit / Fabduino
    • Fab ISP 2.0
    • How to Manually Reset the Start Point on the Epilog Mini Laser Cutter
    • Laser-Cut Acrylic Press-Fit Construction Kit
    • Mercurial Troubleshooting
    • Beginning Fab Academy 2011: Second Year – Assisting
    • Beginning American Sign Language (ASL)
    • Soft Circuit Experiment – LED Matrix Capelet: Part I
    • Making Halloween 2010 – Fairy Costume
    • AS220 Labs Opening Party
    • 6-Axis Sensor AH-6100LR Sample – Thank You Epson!
    • My Illuminated Fab Academy Diploma
    • Fab Academy Graduation – Class of 2010
    • Puppet Master Final Project Page Updated
    • Shopbot Project – Modular Shelving
    • Diploma Completion Checklist Update – 08.14.2010
    • Modela Troubleshooting – Partially Successful Switch to Roland Vinyl Cutter
    • Very Basic Beginner Assembly Tutorial III: How to Use Avrdude
    • Very Basic Beginner Assembly Tutorial II: How to Use Gavrasm to Compile a .asm File
    • Very Basic Assembly Tutorial I: Where to Get Gavrasm for the Mac OS
    • On Self Replication
    • Modified Hello Echo – Part III: Working & Completed Modified Hello Echo + Button + FTDI
    • Modified Hello Echo – Part II: Hello Echo + Button + FTDI
    • The Mantis Hardware + Software Trial Run
    • Modified Hello Echo – Part I: Hello Echo + Button + FTDI
    • First 3D Scans – Modela Scan of Laughing Die and Shell
    • 3D Printing – Interlocking Rings
    • Assembling the MakerBot Cupcake CNC Plastruder mk4 Spindle
    • PuppetMaster v.1-v.2 [capacitive sensing]
    • Fab Academy Completion Checklist
    • Building Lab & Personal Pages
    • Fab Academy Final Project Proposal [revised]: PuppetMaster
    • Hello Serial Echo
    • Hello Step Response FTDI
    • FabISP Part II: Stuffing and Programming the Board
    • Making Serial, Programming and Connector Cables
    • Final Project [PuppetMaster] Licencing and Distribution
    • Internet 0 / Zero – Part 1: Milling, Stuffing and Setting Up the Boards
    • Mantis Milling Machine – Spindle Assembly
    • Fab Academy Final Project Proposal – Puppet Master Universal Remote
    • Best Error Message Ever
    • Using a GUI to Control Processing Output with ControlIP5, Firmata via Serial
    • Fab ISP Part I: Milling Out The Board
    • Motion Sensing Glow Skull
    • Completed TARDIS Cast | Working Light
    • TARDIS: Moldmaking
    • Photo Etching with the Laser Cutter
    • Mammoth Sculpture – Press Fit Acrylic
    • Laser Cut Playing Cards – Construction Kit
    • TARDIS: 3D Modeling
    • Potential Semester Project: Smart Clothing
    • Beginning Fab Academy
    • Atari Punk Console – Round 2
    • Halloween 2009 – Mardi Gras Style
    • Green Dupioni Silk Evening Dress
    • Green Dupoini Evening Bag
    • Experimenting with Context Free
  • Tags

    3D Printing 3D Scanning Arduino AS220 Labs ASL casting chocolate clothing composites costume craft Cupcake CNC Doctor Who dupioni silk ergonomics evening wear Fab ISP FabKit / Fabduino FabRC Gavrasm gestural interface Halloween Haystack Hello World Boards Jimmie P. Rodgers Jonathan Ward Kali Kits language Laser Cutter Machine Knitting MakerBot Maker Faire RI MIT Modela molding MTM Snap Processing Puppet Master ShopBot signed language skulls TARDIS The Mantis tutorials
  • Categories

  • archives

       ANNA KAZIUNAS FRANCE      //     Home  /  About  /  Projects /  Experimentation Log  /  Résumé     

Creative Commons License
All content © 2018 Anna Kaziunas France Some rights reserved. Licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License