GroupLab.Phidgets.NET Library

WARNING: DEPRECATED SOFTWARE

This software is no longer supported. We have replaced it with a completely new version. Please visit: http://grouplab.cpsc.ucalgary.ca/software/ and select the link for Shared Phidgets.

About

The GroupLab.Phidgets.NET library provides a set of Microsoft.NET Common Language Runtime wrappers for the Phidgets™ library. These wrappers make it easier to program phidgets in C# and other .NET languages than using the COM Interop assemblies that automatically generated by Visual Studio .NET.

Download

Current Stable Release:

1.3.5 released Sunday, September 26, 2005

Compatible with Phidgets library v1.3.5

Installer:

GroupLab_Phidgets_NET_v1_3_5.msi

Includes:

Phidget runtime, precompiled .NET binaries, documentation, example programs, full source code

License:

Academic Free License Version 1.2

Online Documentation:

HTML documentation

Book: Programming Phidgets in C#, Chapters 1 - 4

Getting Started

Before you begin…

  1. Use the Add/Remove Programs control panel to uninstall anything Phidget related. The package you will install has all the necessary bits and it is important to start with a clean configuration to avoid conflicts. To verify things are uninstalled, verify that there does NOT exist a file called phidget20.dll in C:\WINDOWS\system32
  2. Remove Phidgets from the Visual Studio .NET Toolbox
    1. Start Visual Studio .NET
    2. Delete any tabs created to hold Phidget.NET wrappers
    3. Delete any items from remaining tabs for Phidget.NET wrappers

 

After you’ve downloaded/installed the package, above…

  1. Start Visual Studio .NET
  2. Right-click the Toolbox and choose ‘Add Tab’ from the context menu. Name the tab “Phidgets”
  3. Click on the Phidgets tab to open it and then right-click inside it and choose ‘Add/Remove items’
  4. Sort the list by Namespace and then place a check mark against all components in the GroupLab.Phidgets and GroupLab.Phidgets.UI namespaces. Click OK to close the dialog box and add the items to the tab. It should appear as follows:

Test it…

  1. Create an empty C# Windows Forms application
  2. From the Toolbox, drag and drop a Servo phidget onto the form. It will appear as an icon in the Windows Forms Designer component tray (a yellow region beneath the form in the designer).
  3. From the Toolbox, drag and drop a ServoSkin control onto your form.
  4. Position and size the control on your form however you wish.
  5. Change the ServoSkin.Servo property from its current value (none) to servo1
  6. Run the program
  7. Attach a Servo motor phidget to the computer. The ServoSkin control on your form should update to reflect that the servo has been attached and you should be able to move the motor by dragging the slider.
  8. If you want, you can experiment with controlling the motor position programmatically:
    1. Drag a Button control onto your form
    2. Add a Click event handler for the button
    3. In the source code for the button event handler, add:

      if(servo1.Motors[0].Position < 90)
      {
         servo1.Motors[0].Position = 180;
      }
      else
      {
         servo1.Motors[0].Position = 0;
      }

    4. Re-run your program and click the button to toggle the motor position between 0° and 180° with each button click.

Known bugs / Future work

Contact

Saul Greenberg (saul@cpsc.ucalgary.ca)