Alert.png

Notice: This page contains information for the legacy Phidget21 Library.

Phidget21 is out of support. Bugfixes may be considered on a case by case basis.

Phidget21 does not support VINT Phidgets, or new USB Phidgets released after 2020. We maintain a selection of legacy devices for sale that are supported in Phidget21.

We recommend that new projects be developed against the Phidget22 Library.


Click on the 2phidget22.jpg button in the menu bar to go to the Phidget22 version of this page.

Alert.png

Template:UsingAPhidgetInCodeSpecific

From Phidgets Legacy Support
Revision as of 21:12, 21 March 2012 by Cora (talk | contribs)

Phidgets’ philosophy is that you do not have to be an electrical engineer in order to do projects that use devices like sensors, motors, motor controllers, and interface boards. All you need to know is how to program.

If this is your first time working with a Phidget, we suggest you start with the [[{{{1}}}|Getting Started]] for the {{{2}}}. The process which begins there will walk you through:

  1. Installing drivers and libraries
  2. Choosing a programming language
  3. Reading about General Phidget Programming, and
  4. Getting code examples for your language

Use those pages to download the examples and learn about the framework in which to develop your own code. You will be referred back here to refer to the specific functions and example layout for the {{{2}}}.

This device-specific API section is deliberately generic. It provides a list of functions available only to the {{{2}}} software object. To get information on what a device-specific function does, you're in the right place. To get specific syntax for that function within your programming language, you'll want the API document from your programming language page.

There are also a handful of functions common to all Phidgets (open, close, etc). If you are looking for a list of these common functions functions common to all Phidgets, you can find them on the API document for your your specific programming language. Help and in-depth information on using these common functions can be found on the General Phidget Programming page.

{{{3}}} {{{2}}} Object

In your code, you should create and use a {{{7}}} object to use the functionality of this board.

In C, for example, this would be the set of {{{4}}} functions, or in Java it would be the {{{5}}} class.

Check the complete API for your programming language to find the specific syntax for the object and the calls below.

{{{3}}} {{{2}}} Code Examples

Examples for the {{{2}}} - as well as a general HelloWorld example - can be found for most of our supported languages.

Visit the page for your language to get the actual examples, and the API with syntax. For a high-level view of the functions you can use on the {{{2}}}, read on.