What is a Phidget?: Difference between revisions

From Phidgets Support
No edit summary
 
(61 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Overview]]
[[Category:Overview]]
<h3>Phidgets are building-block tools for sensing and control from a computer, tablet, or smartphone</h3>.
__NOTOC__
At Phidgets, our philosophy is that you don't have to be an electrical engineer in order to create sophisticated projects using motors, sensors and other electronics. You simply need to know how to code.


<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">


In the programming language of your choice, you create applications that use Phidgets to interact with the physical world.
Phidgets are building-blocks for sensing and control using a computer, tablet, or phone. Phidgets enable your software application to interact with the physical world.


Phidgets connect to a USB port of a computer:
[[File:HUB0000 with LED Image.jpg|link=|250px]]  [[File:RFID Image.jpg|link=|250px]]  [[File:STC1000 with Motor Image.jpg|link=|300px]]


[[File:wiap-image1.png|border|500px|link=|alt=]]
[[File:NoBreadboard.jpg|right|link=|180px]]


</div>


The advantage of using Phidgets is that all Phidgets can be plugged in and used in your project out of the box, without having to follow complex pinout diagrams or configure communication between the device and computer. With Phidgets, we deal with the details of getting the electronics behaving as they should, so you can focus on the programming and details of your final product.
<br clear="all">
==Hardware Introduction==


<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
Phidgets connect via a USB port:
[[Image:wiap-image1.jpg|500px|link=|alt=|center]]


Some Phidgets are a ''complete, self-contained sensing package''. 


One example is our '''Spatial''', which measures motion:
----


[[Image:wiap-image2-spatial.png|border|450px|link=|alt=]]
Some Phidgets are a complete, self-contained sensing package. An example is the [{{SERVER}}/products.php?product_id=1042 1042]
, which measures motion:
[[Image:wiap-image2-spatial.jpg|500px|link=|alt=|center]]


Or, a Phidget may be a ''building block to use other sensors''. 


One example is our '''Temperature Sensor''', which allows use of wire thermocouples:
----


[[Image:wiap-image2-temp.png|border|500px|link=|alt=]]
Other Phidgets are a 'building block' to use other sensors. An example is the [{{SERVER}}/products.php?product_id=1048 1048] which allows the use of wire thermocouples:
[[Image:wiap-image2-temp.jpg|700px|link=|alt=|center]]


Or, a Phidget may be a flexible ''I/O (input/output) board'' which can record and control analog sensors and digital inputs and outputs. 


One example is our '''Interface Kit''' 8/8/8, with eight ports of each type:
----


[[Image:wiap-image2-ifkt.png|border|500px|link=|alt=]]


Other Phidgets are our:
Finally, a Phidget may be a [{{SERVER}}/?view=comparetable&rel=VINTHub VINT Hub], made up of versatile ports that can be used as inputs or outputs, and also connect to smart [[What_is_VINT?|VINT]] devices.
* [{{SERVER}}/products.php?category=1 Analog sensors], which plug into our I/O boards,
[[Image:wiap-vint.jpg|700px|link=|alt=|center]]
* Motors, switches, LEDs, and other components,
* [{{SERVER}}/products.php?category=21 Single Board Computer] - a complete embedded computer, plus Phidget I/O.


</div>
==Programming==


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


<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
{{Programming Languages Table}}


Data and control flows up and down the USB connection:
The Phidget software libraries are supported on a number of operating systems:
{| style="border:1px solid darkgray;" cellpadding="7px;"
|-style="background: #f0f0f0" align=center
|-


[[Image:wiap-image3.png|border|600px|link=|alt=]]
|'''Desktop OSes''' || |'''Mobile/Wireless OSes'''
|-
|[[Image:Icon-Windows.png|alt=OS - Windows|24x24px|link=OS - Windows]][[OS - Windows|Windows]] || |[[Image:Icon-Phidgets.png|alt=OS - Phidget SBC|24x24px|link=OS_-_Phidget_SBC]][[OS_-_Phidget_SBC|Phidget SBC]]
|-
|[[Image:Icon-Linux.png|alt=OS - Linux|24x24px|link=OS - Linux]][[OS - Linux|Linux]] || [[Image:Icon-iOS.png|alt=OS - iOS|link=OS - iOS|24x24px|link=OS - iOS]][[OS - iOS|iOS]] 
|-
|[[Image:Icon-Mac-OS.png|alt=OS - OS X|24x24px|link=OS - OS X]][[OS - OS X|OS X]] || [[Image:Icon-Android.png|alt=OS - Android|link=OS - Android|24x24px|link=OS - Android]][[OS - Android|Android]]
|}


You can use ''more than one Phidget at a time'' to control motors, measure motion, and much, much more.  You can also use multiple sensors, inputs, and outputs on our I/O boards. 
== Network Server ==


Combining these abilities lets you build extensive systems that can sense the environment and react to it.
Using the Phidgets API, applications on remote computers, phones, and [[OS_-_Phidget_SBC|Single Board Computers]] can attach to Phidget devices over the network as if they were local.  This includes WWW based applications using the Phidget JavaScript library.
 
[[Image:NetworkServer_PhidgetServer.jpg|link=|800px|center]]
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
Using Phidgets means writing code.  Within your code, you can create a software object to access our full Phidget library API to access each type of Phidget and use its functions.
 
The software object sends and receives data to and from the Phidget:
 
[[Image:wiap-image4.png|border|500px|link=|alt=]]
 
The software object might be an {{Code|InterfaceKit()}} for an Interface Kit, or a {{Code|PhidgetRFID()}} for an RFID reader, etc.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
We provide support for many different languages to program in:
 
[[Image:wiap-image5.png|border|500px|link=|alt=]]
 
We offer support for even more languages than shown here; please refer to the [[Software Overview]] page for a complete comparison.
 
 
Writing code for your Phidget can be as simple as creating a handle, opening it, getting a sensor value, and printing it.
 
A simple, stripped-down program in C for an Interface Kit might be:
 
<div class="source">
<syntaxhighlight lang=cpp>
#include <stdio.h>
#include <phidget21.h>
 
int main(int argc, char* argv[]) {
    // An "Interface Kit" Phidget Handle
    CPhidgetInterfaceKitHandle device = 0;
 
    // Our Sensor Reading
    int sensorValue;
 
    // Create, open, and attach
    CPhidgetInterfaceKit_create(&device);
    CPhidget_open((CPhidgetHandle) device, -1);
    CPhidget_waitForAttachment((CPhidgetHandle) device, 10000);
 
    // Read Sensor on Port 0
    CPhidgetInterfaceKit_getSensorValue(device, 0, &sensorValue);
 
    printf("Hello World!  My Port 0 sensor reads %d.\n", sensorValue);
 
    // Close and clean up
    CPhidget_close((CPhidgetHandle) device);
    CPhidget_delete((CPhidgetHandle) device);
    return 0;
}
</syntaxhighlight>
</div>
 
The Phidget library includes powerful logging and error checking not shown in this brief program.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
Our libraries are modular.  An Interface Kit software object, for example, has functions you can use to control the Interface Kit specifically, such as setting the output or reading a sensor:
 
[[Image:Manag-singleobject.png|border|300px|link=|alt=]]
 
The object also has a set of common functions that are the same for all Phidgets, such as the way to open, close, and delete:
 
[[Image:Manag-inheritedobject.png|border|300px|link=|alt=]]
 
This common set of Phidget function stays the same across all Phidgets.  The device functions change based on what you can do with each board, such as here for RFID:
 
[[Image:Manag-inheritedobjectII.png|border|300px|link=|alt=]]
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
Not only can you control a Phidget locally, but we also provide a tool called the [[Phidget WebService]]. 
 
The WebService allows you to control a Phidget over your local network:
 
[[Image:webservice_general_broadcast.png|border|700px|link=|alt=]]
 
This allows your to use more than one computer, or even a smartphone:
 
[[Image:webservice_general_pctoandroid.png|border|700px|link=|alt=]]
 
The WebService also includes the [[Phidget Dictionary]], which is a central place to store your data in a distributed application.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
The WebService allows use of operating systems without USB portsSo, we also provide support for many different operating systems:
 
[[Image:wiap-image6.png|border|400px|link=|alt=]]
 
With the WebService, you can even mix and match multiple operating systems to control one Phidget.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
The Phidget Library give the option of using software events, rather than just reading values.
 
With events, you can let the data come to you as it changes:
 
[[Image:wiap-image7.png|border|650px|link=|alt=]]
 
This allows clean integration with GUI programs, which are usually already event-driven.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">
 
The library also includes support for using (and distinguishing between) more than one Phidget in your code - even the same type of Phidget.
 
This is usually done by reference to the unique serial number of each Phidget, as here in a Python code example:
 
[[Image:wiap-image8.png|border|650px|link=|alt=]]
 
There are other ways to do this, such as setting your own labels, or using our [[Phidget Manager]] to detect attached Phidgets.
 
</div>
 
 
<div style="background-color: #f9f9f9; border-color: #1c9edb; border-width:1px; border-style: dashed; padding:15px;">


== Further Reading ==
With the combination of events, modular sensors, and network support, your system can range from simple to incredibly complex.
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.
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:
Want to learn more?  Check out our:
* [{{SERVER}} Products on our main website]
* [{{SERVER}} Products on our main website]
* [[Software Overview | Languages and Operating Systems]]
* [[Phidget Programming Basics]]
* [[:Category:Application Guides | Example project application guides]]
* [{{SERVER}}/?view=articles Example Projects and Articles]
* [[:Category:Primer|In-depth hardware information]]


Questions?  Please {{ContactUs|contact us}}.
Questions?  Please {{ContactUs|contact us}}.
</div>

Latest revision as of 14:50, 26 June 2019


At Phidgets, our philosophy is that you don't have to be an electrical engineer in order to create sophisticated projects using motors, sensors and other electronics. You simply need to know how to code.


Phidgets are building-blocks for sensing and control using a computer, tablet, or phone. Phidgets enable your software application to interact with the physical world.

HUB0000 with LED Image.jpg RFID Image.jpg STC1000 with Motor Image.jpg

NoBreadboard.jpg


The advantage of using Phidgets is that all Phidgets can be plugged in and used in your project out of the box, without having to follow complex pinout diagrams or configure communication between the device and computer. With Phidgets, we deal with the details of getting the electronics behaving as they should, so you can focus on the programming and details of your final product.

Hardware Introduction

Phidgets connect via a USB port:



Some Phidgets are a complete, self-contained sensing package. An example is the 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:




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.

Programming

For the most part, using Phidgets requires writing software. The Phidgets 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++ C/C++ Swift Swift Max/MSP Max/MSP
Python Python Android Android Java
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 OS - AndroidAndroid

Network Server

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

NetworkServer PhidgetServer.jpg

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.

Want to learn more? Check out our:

Questions? Please contact us.