What is a Phidget?: Difference between revisions

From Phidgets Support
No edit summary
Line 78: Line 78:
|[[Image:Icon-CSharp.png|alt=C Sharp|24x24px|link=Language - C Sharp]] [[Language - C Sharp|C#]] || [[Image:Icon-ObjC.png|24x24px|alt=Objective C|link=Language - Objective C]] [[Language - Objective C|Objective C]] || [[Image:Icon-LabVIEW.png|alt=LabVIEW|24x24px|link=Language - LabVIEW]] [[Language - LabVIEW|LabVIEW]]
|[[Image:Icon-CSharp.png|alt=C Sharp|24x24px|link=Language - C Sharp]] [[Language - C Sharp|C#]] || [[Image:Icon-ObjC.png|24x24px|alt=Objective C|link=Language - Objective C]] [[Language - Objective C|Objective C]] || [[Image:Icon-LabVIEW.png|alt=LabVIEW|24x24px|link=Language - LabVIEW]] [[Language - LabVIEW|LabVIEW]]
|-
|-
|[[Image:Icon-C++.png|alt=C/C++|24x24px|link=Language - C/C++]] [[Language - C/C++|C/C++]] || |[[Image:Icon-Swift.png|alt=Swift|24x24px|link=Language - Swift]] [[Language - Swift|Swift]] || |[[Image:Icon-MaxMSP.png|24x24px|alt=Max/MSP|link=Language - Max/MSP]] [[Language - Max/MSP|Max/MSP]]
|[[Image:Icon-C.png|alt=C|24x24px|link=Language - C]] [[Language - C|C]] || |[[Image:Icon-Swift.png|alt=Swift|24x24px|link=Language - Swift]] [[Language - Swift|Swift]] || |[[Image:Icon-MaxMSP.png|24x24px|alt=Max/MSP|link=Language - Max/MSP]] [[Language - Max/MSP|Max/MSP]]
|-
|-
|[[Image:Icon-Python.png|alt=Python|24x24px|link=Language - Python]] [[Language - Python|Python]]
|[[Image:Icon-Python.png|alt=Python|24x24px|link=Language - Python]] [[Language - Python|Python]]

Revision as of 19:29, 13 July 2017


Introduction

Phidgets are building-blocks for sensing and control using a computer, tablet, or phone. Users create applications that use Phidgets to interact with the physical world. Phidgets connect via a USB port:



Some Phidgets are a complete, self-contained sensing package. An example is then 1042 , which measures motion:



Other Phidgets are a 'building block' to use other sensors. An example is the 1048 which allows the use of wire thermocouples:



Another Phidget may be a flexible I/O board which can receive analog sensor data and control digital inputs and outputs. An example is the 1018, with eight ports of each type:



Finally, a Phidget may be a VINT Hub, made up of versatile ports that can be used as inputs or outputs, and also connect to smart VINT devices.

Data Flow

Data and control flows up and down the USB connection:

Software Channels

A Phidget device exports one or more channels. Each device channel implements a channel class where that class defines the interface used to access the features of the device in a generic fashion. For example, a Phidget device that supports sensing voltage exports a channel that implements the VoltageInput class. The VoltageInput class defines the methods, properties, events and errors relevant to receiving voltage data.


You can check the Phidget22 API for details about channel classes. For example, the 1018 has five channels (with five distinct channel classes):

Each Phidget channel class inherits common functionality from the base Phidget class. The Phidget class defines methods like open() and close(), and properties like DeviceSerialNumber.

To help understand the concepts above, we have included a simple C# program that can be used with the 1018.

using Phidget22;

int main() {
    VoltageInput vin;            // A user channel of the class VoltageInput

    vin = new VoltageInput();    // Create an instance of the class    
    vin.Channel = 0;             // Specify the index of the device channel to attach to
    vin.Open(5000);              // Begin attempting to attach to the device channel

    System.Console.WriteLine("My channel 0 sensor reads " + vin.Voltage); // Get the voltage value

    vin.Close();                 // Close the channel, which detached it from the device channel
}


Programming

For the most part, using Phidgets requires writing software. The Phidget22 API is available in many different programming languages:

Core Languages Mobile Languages Other Languages
C Sharp C# Objective C Objective C LabVIEW LabVIEW
C C Swift Swift Max/MSP Max/MSP
Python Python
Java Java
Visual Basic .NET Visual Basic .NET
JavaScript JavaScript


The Phidget software libraries are supported on a number of operating systems:

Desktop OSes Mobile/Wireless OSes
OS - WindowsWindows OS - Phidget SBCPhidget SBC
OS - LinuxLinux OS - iOSiOS
OS - OS XOS X

Network Server

Phidget devices can be accessed remotely by using the Phidget Network Server. The Network Server exports the channels of each attached Phidget over the network:

NetworkServer PhidgetServer.jpg

Using the Phidget22 API, clients on remote computers, phones, and Single Board Computers can attach to Phidget devices as if they were local. This includes WWW based applications using the Phidget JavaScript library.

Further Reading

With the combination of events, modular sensors, and network support, your system can range from simple to incredibly complex.

We encourage customers to not only build projects for themselves, but also to design and build real-world products using Phidgets. Our libraries can be distributed with your code to your customers.

And this can all occur with the same devices, and the same flexible software API.

Want to learn more? Check out our:

Questions? Please contact us.