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:ExamplePseudocode

From Phidgets Legacy Support
Revision as of 17:32, 14 November 2011 by Cora (talk | contribs) (Created page with "<div style="background-color: #f3f3f3; border-color: #1c9edb; border-width:1px; border-style: dashed;"> <font size="3"> <source lang=cpp> // --- Event Functions --- Create ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

  // --- Event Functions ---

  Create any Language-Specific Functions (exception handling)

  Create General Attach, Detach, and Error Handling Functions
      On attach: Initialize hardware (antennas, etc)
      On detach: Reset any state variables

  Create Hardware-Specific Functions
      Print messages to notify they are called
      Perform minor accompanying changes (turn on LED, etc)

  // --- Main Code ---

  Create Device Software Object
  Hook Event Functions created above to Device
  Open Device

  Loop waiting on events and user input:
      Get and Print various device statuses on request by input
      Handle on-going attach and detach events
      Exit upon specific user input

  Close Device
  Delete Device