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: Difference between revisions

From Phidgets Legacy Support
No edit summary
No edit summary
Line 1: Line 1:
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.
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}}}|Start Here]] for the {{{2}}}.  The process which begins there will walk you through:
''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:
# Installing drivers and libraries  
# Installing drivers and libraries  
# Choosing a programming language  
# Choosing a programming language  

Revision as of 18:43, 21 March 2012

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 simply provides a list of functions available only to the {{{2}}} software object.

If you are looking for an API list of functions common to all Phidgets, you want the General Phidget API. The General API is also deliberately generic, so if you want details, you should get the API documentation from the page on your specific programming language.

{{{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

The {{{2}}} examples, regardless of programming language, try to follow this layout. If specific code does not exist for the {{{2}}}, the outline below may still help with any code you write: {{{6}}} 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.