AnalogOut
The AnalogOut widget sends a continuous range of numbers to its output. It normally controls the PWM (pulse width modulation) outputs of a microcontroller. Based on the inputSource values the amount of power supplied (i.e. the duty cycle) is ramped up or down. PWM outputs are typically used to control the brightness of LEDs or speed of motor by setting the power output of the PWM port, where a higher number delivers more power.
In some cases, you may want to shape the output of AnalogOut so that it follows an envelope, ramping up and down as its input rises. This functionality is available in a separate processing widget call Envelope.
On Screen Features
- connect – Button at the top-right of the widget establishes a connection with the microcontroller
Parameters
- controller – Determines which kind of controller the widget communicates with, Arduino, Make, or OSC (XBee not supported). This can also be set to hubFeed to send a generic feed of values to a hub that can be read by another widget or project, even one one running on a different computer.
- controllerIP – Sets the IP address used to communicate with the Make Controller
- controllerOutputNum – The PWM port on the microcontroller. For the Arduino Duemilanove and UNO, use ports 3,5,6,10,11 or 12 (for other Arduinos, check your documentation). For the Make Controller, should be 0-3.
- controllerPort – Sets the IP Port used to communicate with the Make Controller in combination with the CONTROLLER IP. By default this is 10000.
- hubFeedName – The name of the Hub feed we’re creating. The hubFeed controller option allows the application to send output to any Hub. For example, you can send a feed to a remote computer (or in the future a tablet) which can be read with a corresponding AnalogIn widget set to hubFeed. See also the AnalogIn for receiving a hub feed. If you want to send a hub feed to a remote computer running its own hub, set the remoteHubIP parameter to the IP address of that computer. The oscDivider also applies to a hubFeed.
- inputSource – The instance name of the source the widget listens to, e.g AnalogIn.
- invisible – If set to “true” or checked, the widget will disappear when the Flash movie is run - NOTE: you can make all the widgets invisible interactively when the Flash moving is running by pressing the backslash key “\”
- multiplier – Used when the controller is set to OSC and HubFeed. Many OSC devices and software require fractional values from 0-1. To provide the appropriate numbers for the output to the device/software the toolkit numbers may need to be turned into the appropriate fractional numbers. By setting multiplier, any number coming into the AnalogOut will be multiplied by this number and output. E.g. set the multiplier to 0.001 to change numbers in the range 0-1000 to a range of 0-1. To be exact for numbers ranging from 0-1023, use a multiplier of 0.0009775171.
- oscString – This is the OSC message that AnalogOut will send. For example if the string is set to ”/slider/1″, the device or software will sent that message with the AnalogOut value – e.g. “/slider/1 0.345.
- remoteHubIP – This sets the IP address of the Hub where the widget will send values to a microcontroller. Normally this would be 127.0.0.1 for the Hub running locally. But if you want to send values to a Hub and microcontroller running on a remote computer, change this IP to the address of the remote computer. In this way, widgets on multiple computers can a microcontroller on a remote computer with outputs attached. Note that even if you are using a remote Hub, the Hub application must also be running locally on the same machine as the widgets. Also applies to a hubFeed.
- serialPort – For widgets set to communicate with an Arduino or XBee, the USB serial port name that the device is connected to. On the Mac, you can leave the default (/dev/cu.usb*) if only one device is hooked up. On the PC, replace this with the COM port used, e.g. COM7. For more detailed info on how to set this parameter, see the common features for all widgets discussion here.
Working with the Arduino
see the Arduino setup information on this page.
Working with the Make Controller
Please see the Make ethernet communications documentation here.
Working with OSC
AnalogOut can send OSC messages to any device using the OSCstring parameter. It will divide its output value by the oscDivider parameters.
For more information, see the OSC tutorial.
Last modified January 29th, 2012

