<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.phidgets.com/docs/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lmpacent</id>
	<title>Phidgets Support - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.phidgets.com/docs/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lmpacent"/>
	<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/Special:Contributions/Lmpacent"/>
	<updated>2026-09-11T23:47:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35718</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35718"/>
		<updated>2026-09-11T15:22:52Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Payment Terms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail sales@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
===Sales Tax===&lt;br /&gt;
Applicable state, provincial, or country sales tax will be charged where required, unless a valid exemption or resale certificate has been submitted to and approved by Phidgets Inc.&lt;br /&gt;
&lt;br /&gt;
To apply for tax-exempt status, please email the following to [mailto:sales@phidgets.com sales@phidgets.com]:&lt;br /&gt;
* Your Phidgets customer account name or the email address associated with your account&lt;br /&gt;
* A PDF copy of your tax exemption or resale certificate, including the organization name and any applicable ID numbers&lt;br /&gt;
&lt;br /&gt;
If an order is placed before your exemption status has been reviewed and approved, applicable taxes will be charged.&lt;br /&gt;
&lt;br /&gt;
All taxes collected are remitted to the appropriate governing authorities in accordance with applicable laws and regulations.&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Phidgets_logo_circle_small.png&amp;diff=35708</id>
		<title>File:Phidgets logo circle small.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Phidgets_logo_circle_small.png&amp;diff=35708"/>
		<updated>2026-09-02T21:58:08Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Phidgets-HexLogo-Wide-Medium.png&amp;diff=35707</id>
		<title>File:Phidgets-HexLogo-Wide-Medium.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Phidgets-HexLogo-Wide-Medium.png&amp;diff=35707"/>
		<updated>2026-08-31T18:04:21Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Phidgets-HexLogo-Icon-Medium_circle.png&amp;diff=35706</id>
		<title>File:Phidgets-HexLogo-Icon-Medium circle.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Phidgets-HexLogo-Icon-Medium_circle.png&amp;diff=35706"/>
		<updated>2026-08-31T17:22:06Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Draw-Wire_Sensor_Guide&amp;diff=35690</id>
		<title>Draw-Wire Sensor Guide</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Draw-Wire_Sensor_Guide&amp;diff=35690"/>
		<updated>2026-07-31T18:49:53Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Which Draw-Wire Sensor Should I Use? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=What is a draw-wire sensor? Learn what a draw-wire sensor is, how they work, and how you can use them with Phidgets.}}&lt;br /&gt;
__TOC__&lt;br /&gt;
[[Category:IntroGuide]]&lt;br /&gt;
[[Image:Drawwire_intro.jpg|400px|link=https://cdn.phidgets.com/docs/images/7/73/Drawwire_intro.jpg|thumb|&amp;lt;center&amp;gt;Draw-wire encoder ([https://www.phidgets.com/?prodid=1260 ENC4118_0])&amp;lt;/center&amp;gt;]]&lt;br /&gt;
==What Is a Draw-Wire Sensor?==&lt;br /&gt;
Draw-wire sensors provide an accurate and cost-effective method of measuring an object&#039;s linear position and/or speed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As the draw-wire is pulled from the housing, a digital signal is generated which provides precise information about the length of the extended draw-wire.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
===Example - Length Measurement===&lt;br /&gt;
[[File:drawwire_example.webm|600px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;The [https://www.phidgets.com/?prodid=1260 ENC4118] is used with an [https://www.phidgets.com/?prodid=959 Quadrature Encoder Phidget] and a [https://www.phidgets.com/?tier=2&amp;amp;catid=64&amp;amp;pcid=57 VINT Hub Phidget] (offscreen) to measure length. The results are displayed on a [https://www.phidgets.com/?prodid=963 Graphic LCD Phidget]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Which Draw-Wire Sensor Should I Use?==&lt;br /&gt;
Phidgets Inc. currently offers three types of draw-wire sensors:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{| style=&amp;quot;margin:auto;width:85%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Product ID !! !! Draw-Wire Length !! Resolution !! Max Pull Speed !! Max Wire Load !! Index Signal&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.phidgets.com/?prodid=1260 ENC4118_0] || || 1m || 10µm || 300mm/s || 500g || Yes ||[[Image:ENC4118_0.jpg|200px|link=https://cdn.phidgets.com/docs/images/8/84/ENC4118_0.jpg]] &lt;br /&gt;
|-&lt;br /&gt;
| [https://www.phidgets.com/?prodid=1261 ENC4119_0] || || 3m || 20µm || 300mm/s || 500g || Yes ||[[Image:ENC4119_0.jpg|200px|link=https://cdn.phidgets.com/docs/images/7/73/ENC4119_0.jpg]] &lt;br /&gt;
|-&lt;br /&gt;
| [https://www.phidgets.com/?prodid=1396 ENC4129_0] || || 5m || 10µm || 300mm/s || 500g || Yes ||[[Image:ENC4129_0.jpg|200px|link=https://cdn.phidgets.com/docs/images/a/a3/ENC4129_0.jpg]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==How Do I Get Data From My Draw-Wire Sensor?==&lt;br /&gt;
All draw-wire sensors sold by Phidgets Inc. connect directly to our [https://www.phidgets.com/?tier=1&amp;amp;catid=4&amp;amp;pcid=2 encoder interfaces]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Enc1000_drawwire_connected.jpg|600px|link=https://cdn.phidgets.com/docs/images/7/77/Enc1000_drawwire_connected.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The encoder interface will monitor the output of the draw-wire sensor and update your software with an easy-to-use encoder count value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are also encoder interfaces built into many of our [https://www.phidgets.com/?tier=1&amp;amp;catid=71&amp;amp;pcid=15 Motor Controllers]. If your project includes a motor controller, the onboard encoder interface is a great option for our draw-wire sensors.&lt;br /&gt;
&lt;br /&gt;
===Converting Encoder Count to Length===&lt;br /&gt;
[[Image:Drawwire_resolution.png|400px|link=https://cdn.phidgets.com/docs/images/f/f2/Drawwire_resolution.png|thumb|&amp;lt;center&amp;gt;Resolution Specification for the [https://www.phidgets.com/?prodid=1260#Tab_Specifications ENC4118_0]&amp;lt;/center&amp;gt;]]&lt;br /&gt;
To convert from encoder pulses to length, use the &#039;&#039;&#039;resolution&#039;&#039;&#039; specification that is provided on the product page of your draw-wire sensor. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This value can be found on the &#039;&#039;Specifications&#039;&#039; tab and is presented as &#039;&#039;&#039;micrometers per pulse.&#039;&#039;&#039; For more information, review the example code below.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
====Example Code====&lt;br /&gt;
The code below is derived from the [https://www.phidgets.com/?view=code_samples Phidget Code Sample Generator]. It shows how to convert position data from an encoder interface into a length measurement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on your preferred programming language to view the code example.&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
Python=&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.Encoder import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def onPositionChange(self, positionChange, timeChange, indexTriggered):&lt;br /&gt;
	resolution = 10E-6 #The ENC4118_0 has a resolution of 10um/pulse, replace with your product&#039;s resolution&lt;br /&gt;
	meters = self.getPosition() * resolution&lt;br /&gt;
	print(&amp;quot;Length: &amp;quot; + str(round(meters, 3)) + &amp;quot; m&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
	encoder0 = Encoder()&lt;br /&gt;
&lt;br /&gt;
	encoder0.setOnPositionChangeHandler(onPositionChange)&lt;br /&gt;
&lt;br /&gt;
	encoder0.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	time.sleep(5)&lt;br /&gt;
&lt;br /&gt;
	encoder0.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Java=&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
import com.phidget22.*;&lt;br /&gt;
import java.lang.InterruptedException;&lt;br /&gt;
&lt;br /&gt;
public class Java_Example {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        Encoder encoder0 = new Encoder();&lt;br /&gt;
&lt;br /&gt;
        encoder0.addPositionChangeListener(new EncoderPositionChangeListener() {&lt;br /&gt;
            public void onPositionChange(EncoderPositionChangeEvent e) {&lt;br /&gt;
                try {&lt;br /&gt;
                    Encoder evChannel = (Encoder) e.getSource();&lt;br /&gt;
                    double resolution = 10E-6; //The ENC4118_0 has a resolution of 10um/pulse, replace with your product&#039;s resolution&lt;br /&gt;
                    double meters = evChannel.getPosition() * resolution;&lt;br /&gt;
                    System.out.println(&amp;quot;Length: &amp;quot; + Math.round(meters * 1000.0) / 1000.0 + &amp;quot; m&amp;quot;);&lt;br /&gt;
                } catch (PhidgetException ex) {&lt;br /&gt;
                    ex.printStackTrace();&lt;br /&gt;
                    System.out.println(&amp;quot;PhidgetException &amp;quot; + ex.getErrorCode() + &amp;quot; (&amp;quot; + ex.getDescription() + &amp;quot;): &amp;quot; + ex.getDetail());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        encoder0.open(5000);&lt;br /&gt;
&lt;br /&gt;
        Thread.sleep(5000);&lt;br /&gt;
&lt;br /&gt;
        encoder0.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
C#=&amp;lt;syntaxhighlight lang=cSharp&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using Phidget22;&lt;br /&gt;
&lt;br /&gt;
namespace ConsoleApplication&lt;br /&gt;
{&lt;br /&gt;
	class Program&lt;br /&gt;
	{&lt;br /&gt;
&lt;br /&gt;
		private static void Encoder0_PositionChange(object sender, Phidget22.Events.EncoderPositionChangeEventArgs e)&lt;br /&gt;
		{&lt;br /&gt;
			Phidget22.Encoder evChannel = (Phidget22.Encoder)sender;&lt;br /&gt;
			double resolution = 10E-6; //The ENC4118_0 has a resolution of 10um/pulse, replace with your product&#039;s resolution&lt;br /&gt;
			double meters = evChannel.Position * resolution;&lt;br /&gt;
			Console.WriteLine(&amp;quot;Length: &amp;quot; + Math.Round(meters, 3) + &amp;quot; m &amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		static void Main(string[] args)&lt;br /&gt;
		{&lt;br /&gt;
			Encoder encoder0 = new Encoder();&lt;br /&gt;
&lt;br /&gt;
			encoder0.PositionChange += Encoder0_PositionChange;&lt;br /&gt;
&lt;br /&gt;
			encoder0.Open(5000);&lt;br /&gt;
&lt;br /&gt;
			System.Threading.Thread.Sleep(10000);&lt;br /&gt;
&lt;br /&gt;
			encoder0.Close();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
C=&amp;lt;syntaxhighlight lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;phidget22.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
/* Determine if we are on Windows of Unix */&lt;br /&gt;
#ifdef WIN32&lt;br /&gt;
#include &amp;lt;windows.h&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#define Sleep(x) usleep((x) * 1000)&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
static void CCONV onPositionChange(PhidgetEncoderHandle ch, void * ctx, int positionChange, double timeChange, int indexTriggered) {&lt;br /&gt;
	int64_t position;&lt;br /&gt;
	double resolution = 10E-6; //The ENC4118_0 has a resolution of 10um/pulse, replace with your product&#039;s resolution&lt;br /&gt;
	PhidgetEncoder_getPosition(ch, &amp;amp;position);&lt;br /&gt;
	double meters = resolution * position;&lt;br /&gt;
	printf(&amp;quot;Length: %.3f\n m&amp;quot;, meters);&lt;br /&gt;
	printf(&amp;quot;----------\n&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() {&lt;br /&gt;
	PhidgetEncoderHandle encoder0;&lt;br /&gt;
&lt;br /&gt;
	PhidgetEncoder_create(&amp;amp;encoder0);&lt;br /&gt;
&lt;br /&gt;
	PhidgetEncoder_setOnPositionChangeHandler(encoder0, onPositionChange, NULL);&lt;br /&gt;
&lt;br /&gt;
	Phidget_openWaitForAttachment((PhidgetHandle)encoder0, 5000);&lt;br /&gt;
&lt;br /&gt;
	Sleep(5000);&lt;br /&gt;
&lt;br /&gt;
	Phidget_close((PhidgetHandle)encoder0);&lt;br /&gt;
&lt;br /&gt;
	PhidgetEncoder_delete(&amp;amp;encoder0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
====Speed Calculations====&lt;br /&gt;
If you are interested in calculating the speed of your draw-wire sensor, a simple Python example is provided below.&lt;br /&gt;
&lt;br /&gt;
In order to implement more accurate speed calculations, review the [https://www.phidgets.com/?view=articles&amp;amp;article=EncoderVelocity Encoder Velocity: A Common Miscalculation] guide for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.Encoder import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def onPositionChange(self, positionChange, timeChange, indexTriggered):&lt;br /&gt;
    resolution = 10E-6 #The ENC4118_0 has a resolution of 10um/pulse, replace with your product&#039;s resolution&lt;br /&gt;
    speed = (positionChange * resolution) / (timeChange/1000.0)&lt;br /&gt;
    print(&amp;quot;Speed: &amp;quot; + str(round(speed, 3)) + &amp;quot; m/s&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    encoder0 = Encoder()&lt;br /&gt;
&lt;br /&gt;
    encoder0.setOnPositionChangeHandler(onPositionChange)&lt;br /&gt;
&lt;br /&gt;
    encoder0.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
    time.sleep(5000)&lt;br /&gt;
&lt;br /&gt;
    encoder0.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation and Mounting==&lt;br /&gt;
M5 mounting holes are available on the back of the housing and on the end of the draw wire. For more information, view the mechanical drawings for your product which can be found on the product page under the &#039;&#039;Specifications&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot;&amp;gt;&lt;br /&gt;
File:ENC4118_0_MountingHoles2.jpg | link=/images/7/79/ENC4118_0_MountingHoles2.jpg&lt;br /&gt;
File:ENC4118_0_MountingHoles.jpg | link=/images/3/35/ENC4118_0_MountingHoles.jpg&lt;br /&gt;
File:ENC4119_0_MountingHoles.jpg | link=/images/0/0b/ENC4119_0_MountingHoles.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:ENC4129_0.jpg&amp;diff=35689</id>
		<title>File:ENC4129 0.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:ENC4129_0.jpg&amp;diff=35689"/>
		<updated>2026-07-31T18:48:59Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=35681</id>
		<title>Language - C</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C&amp;diff=35681"/>
		<updated>2026-06-11T21:08:33Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* C Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with C and C++.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
== Get Started ==&lt;br /&gt;
With the Phidget22 library, it&#039;s easy to create C or C++ applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
== C Libraries ==&lt;br /&gt;
If you&#039;ve installed the Phidget drivers for [[OS - Windows|Windows]], [[OS - macOS|macOS]], or [[OS - Linux|Linux]], then you already have the files you need for your C project. &lt;br /&gt;
&lt;br /&gt;
==== Windows Considerations ====&lt;br /&gt;
When adding directories for your project dependencies, add&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
C:/Program Files/Phidgets/Phidget22&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And for the linker, you can add&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
C:/Program Files/Phidgets/Phidget22/phidget22.lib}}     #(for 64-bit systems)&lt;br /&gt;
C:/Program Files/Phidgets/Phidget22/x86/phidget22.lib}} #(for 32-bit systems)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. &lt;br /&gt;
&lt;br /&gt;
To run your C application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
=== Library Files ===&lt;br /&gt;
If you would like to manually manage the Phidget22 library files, you can download them [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip here].&lt;br /&gt;
&lt;br /&gt;
== Development Environment Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== GCC === &lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| &lt;br /&gt;
The most common tool for C development is GCC, whether used in the command line or through an IDE. GCC is packaged with many other IDEs and packages, so you may already have it installed.&lt;br /&gt;
&lt;br /&gt;
{{hiddenh4|Windows}}&lt;br /&gt;
We recommend installing [https://www.cygwin.com/ Cygwin] or [https://sourceforge.net/projects/mingw/ MinGW], ensuring you select all gcc packages when prompted by the installer.  &lt;br /&gt;
&lt;br /&gt;
To compile your code, go to the folder where your code is and open the command prompt by typing &#039;cmd&#039; in the address bar.&lt;br /&gt;
&lt;br /&gt;
The specific command you will use depends on your compiler of choice:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#Cygwin x86:&lt;br /&gt;
gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets/Phidget22&amp;quot;-L&amp;quot;/cygdrive/c/Program Files/Phidgets/Phidget22/x86&amp;quot; -lphidget22&lt;br /&gt;
&lt;br /&gt;
#Cygwin x64:&lt;br /&gt;
gcc example.c -o example -I&amp;quot;/cygdrive/c/Program Files/Phidgets/Phidget22&amp;quot; -L&amp;quot;/cygdrive/c/Program Files/Phidgets/Phidget22&amp;quot; -lphidget22&lt;br /&gt;
&lt;br /&gt;
#MinGW:&lt;br /&gt;
gcc example.c -o example -I&amp;quot;C:/Program Files/Phidgets/Phidget22&amp;quot; -L&amp;quot;C:/Program Files/Phidgets/Phidget22/x86&amp;quot; -lphidget22&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After running the commands above for either Cygwin or MinGW, an executable file called example.exe will be created. Enter the following command to run the program:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
./example.exe&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{hiddenh4|MacOS}}&lt;br /&gt;
If you don&#039;t already have gcc installed, you can get it by installing [https://developer.apple.com/xcode/ Xcode].&lt;br /&gt;
&lt;br /&gt;
To compile the program, enter the following command in the terminal, substituting &amp;quot;example&amp;quot; for the name of your C file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gcc example.c -o example -F /Library/Frameworks -framework Phidget22 -I /Library/Frameworks/Phidget22.framework/Headers&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Finally, run the program by entering the following command in the terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
./example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Success! The project is now running with Phidgets.&lt;br /&gt;
&lt;br /&gt;
{{hiddenh4|Linux}}&lt;br /&gt;
On Linux, gcc is installed through the package manager:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
apt-get install gcc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To compile the program, enter the following command in the terminal, substituting &amp;quot;example&amp;quot; for the name of your C file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
gcc example.c -o example -lphidget22&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
After compiling, you can run the program by entering the following command in the terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
./example&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Success! The project is now running with Phidgets.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio === &lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| If you want to jump right into a pre-configured project, you can download one on our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=C Code Sample Generator] page. || [[Image:Language_C_VSProject.jpg|center|link=https://cdn.phidgets.com/docs/images/f/f1/Language_C_VSProject.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| To configure a new project, follow these steps. ||&lt;br /&gt;
|-&lt;br /&gt;
| First, create a new Win32 Console Application: || [[Image:Language_C_VS_step1.jpg|center|link=https://cdn.phidgets.com/docs/images/a/a1/Language_C_VS_step1.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| If you are using a 64-bit machine, select x64, otherwise, select x86: || [[Image:Language_C_VS_step2.jpg|center|link=https://cdn.phidgets.com/docs/images/6/6b/Language_C_VS_step2.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, right click on the source folder and click New Item: || [[Image:Language_C_VS_step3.jpg|center|link=https://cdn.phidgets.com/docs/images/e/e1/Language_C_VS_step3.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Give the source file a name and click Add: || [[Image:Language_C_VS_step4.jpg|center|link=https://cdn.phidgets.com/docs/images/e/e5/Language_C_VS_step4.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Right click your project and access its properties: || [[Image:Language_C_VS_step5.jpg|center|link=https://cdn.phidgets.com/docs/images/1/1e/Language_C_VS_step5.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Go to Configuration Properties -&amp;gt; C/C++ -&amp;gt; General and add this to the additional include directories:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
C:\Program Files\Phidgets\Phidget22&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| [[Image:Language_C_VS_step6.jpg|center|link=https://cdn.phidgets.com/docs/images/d/d3/Language_C_VS_step6.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Go to Configuration Properties -&amp;gt; Linker -&amp;gt; Input and add the appropriate line to additional dependencies:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
C:\Program Files\Phidgets\Phidget22\phidget22.lib #(for 64-bit systems)&lt;br /&gt;
C:\Program Files\Phidgets\Phidget22\x86\phidget22.lib #(for 32-bit systems)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| [[Image:Language_C_VS_step7.jpg|center|link=https://cdn.phidgets.com/docs/images/0/09/Language_C_VS_step7.jpg|350px]]&lt;br /&gt;
|-&lt;br /&gt;
| Lastly, include the Phidget library at the beginning of your program:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#include &amp;lt; phidget22.h &amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PhidgetSBC Web Interface ===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;center&amp;gt;{{#ev:youtube|2hTlVexctqY|rel=0}}&amp;lt;/center&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example Code ==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=C Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_c_codesample2.png|center|600px|link=]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=C Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35633</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35633"/>
		<updated>2026-05-06T18:30:50Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Sales Tax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
===Sales Tax===&lt;br /&gt;
Applicable state, provincial, or country sales tax will be charged where required, unless a valid exemption or resale certificate has been submitted to and approved by Phidgets Inc.&lt;br /&gt;
&lt;br /&gt;
To apply for tax-exempt status, please email the following to [mailto:sales@phidgets.com sales@phidgets.com]:&lt;br /&gt;
* Your Phidgets customer account name or the email address associated with your account&lt;br /&gt;
* A PDF copy of your tax exemption or resale certificate, including the organization name and any applicable ID numbers&lt;br /&gt;
&lt;br /&gt;
If an order is placed before your exemption status has been reviewed and approved, applicable taxes will be charged.&lt;br /&gt;
&lt;br /&gt;
All taxes collected are remitted to the appropriate governing authorities in accordance with applicable laws and regulations.&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35632</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35632"/>
		<updated>2026-05-06T18:29:44Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Sales Tax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
===Sales Tax===&lt;br /&gt;
Applicable state, provincial, or country sales tax will be charged when required, unless a valid exemption or resale certificate has been submitted to and approved by Phidgets Inc.&lt;br /&gt;
&lt;br /&gt;
To apply for tax-exempt status, please email the following to [mailto:sales@phidgets.com sales@phidgets.com]:&lt;br /&gt;
* Your Phidgets customer account name or the email address associated with your account&lt;br /&gt;
* A PDF copy of your tax exemption or resale certificate, including the organization name and any applicable ID numbers&lt;br /&gt;
&lt;br /&gt;
If an order is placed before your exemption status has been reviewed and approved, applicable taxes will be charged.&lt;br /&gt;
&lt;br /&gt;
All taxes collected are remitted to the appropriate governing authorities in accordance with applicable laws and regulations.&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35631</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35631"/>
		<updated>2026-05-06T18:28:50Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Sales Tax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
===Sales Tax===&lt;br /&gt;
Applicable state, provincial, or country sales tax will be charged where required, unless a valid exemption or resale certificate has been submitted to and approved by Phidgets Inc.&lt;br /&gt;
&lt;br /&gt;
To apply for tax-exempt status, please email the following to [mailto:sales@phidgets.com sales@phidgets.com]:&lt;br /&gt;
* Your Phidgets customer account name or the email address associated with your account&lt;br /&gt;
* A PDF copy of your tax exemption or resale certificate, including the organization name and any applicable ID numbers&lt;br /&gt;
&lt;br /&gt;
If an order is placed before your exemption status has been reviewed and approved, applicable taxes will be charged.&lt;br /&gt;
&lt;br /&gt;
All taxes collected are remitted to the appropriate governing authorities in accordance with applicable laws and regulations.&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35630</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35630"/>
		<updated>2026-05-01T17:15:56Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Payment Terms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
===Sales Tax===&lt;br /&gt;
All orders will be subject to applicable state, provincial, or country sales tax, unless a valid exemption or resale certificate has been submitted to and approved by Phidgets Inc.&lt;br /&gt;
&lt;br /&gt;
To apply for tax-exempt status, please email the following to [mailto:sales@phidgets.com sales@phidgets.com]:&lt;br /&gt;
* Your Phidgets customer account name or the email address associated with your account&lt;br /&gt;
* A PDF copy of your tax exemption or resale certificate, including the organization name and any applicable ID numbers&lt;br /&gt;
&lt;br /&gt;
If an order is placed before your exemption status has been reviewed and approved, applicable taxes will be charged.&lt;br /&gt;
&lt;br /&gt;
All taxes collected are remitted to the appropriate governing authorities in accordance with applicable laws and regulations.&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35629</id>
		<title>OS - macOS</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35629"/>
		<updated>2026-04-21T15:12:15Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Quick Downloads */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers, and relays with Phidgets! Program in macOS using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support macOS 10.11 and newer.&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/tools/macos/Phidget22ControlPanel.dmg Phidget22 Control Panel (for macOS 10.15 and newer)]&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22.dmg Phidget22 Installer (for macOS 10.14 and earlier)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files]&lt;br /&gt;
* [{{SERVER}}/downloads/phidget22/libraries/macos/Phidget22/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with macOS==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|package]] for your machine from the list above. This will install the Phidget Control Panel and the Phidget Network Server. These are powerful tools that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After downloading, drag the application into your Applications folder:&lt;br /&gt;
[[Image:Macos_standalone_install.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
You can then find the application in the Applications folder by searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
[[Image:Macos_applications_controlpanel.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|600px|center]]&lt;br /&gt;
&lt;br /&gt;
When you open the application for the first time, you will see the following notice:&lt;br /&gt;
[[Image:Macos_install_extension.png|link=https://cdn.phidgets.com/docs/images/9/9e/Macos_install_extension.png|300px|center]]&lt;br /&gt;
&lt;br /&gt;
Follow the link in the pop-up, or navigate to &#039;&#039;System Settings &amp;gt; General &amp;gt; Login Items &amp;amp; Extensions &amp;gt; Extensions&#039;&#039;, and give permissions:&lt;br /&gt;
[[Image:Macos_install_extension_permission.png|link=https://cdn.phidgets.com/docs/images/a/ac/Macos_install_extension_permission.png|600px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Note: The driver extension is only required for legacy USB Phidgets running a HID USB stack. Refer to your product’s specifications page for information about its USB stack.&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After running the application, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network.&lt;br /&gt;
[[Image:Os_macos_controlpanel.png|600px|link=https://cdn.phidgets.com/docs/images/a/a1/Os_macos_controlpanel.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the arrow beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Os_macos_controlpanel_example.png‎|link=https://cdn.phidgets.com/docs/images/3/37/Os_macos_controlpanel_example.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35625</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35625"/>
		<updated>2026-04-15T16:12:13Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Security and Privacy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
{{ContactUs|Contact us}} if you have any questions or concerns about our Security and Privacy policy.&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35624</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35624"/>
		<updated>2026-04-15T16:11:33Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Security and Privacy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. If you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
If you have any questions or concerns about our Security and Privacy policy, call us at 1.403.282.7335 or e-mail us at support@phidgets.com&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_SPI_Encoder&amp;diff=35623</id>
		<title>Controlling an SPI Encoder</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_SPI_Encoder&amp;diff=35623"/>
		<updated>2026-04-15T15:48:57Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=SPI Adapter}}&lt;br /&gt;
{{#seo:|description=Control an SPI encoder with the SPI Adapter Phidget}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:Adp0002_spiencoder_primary.png|thumb|link=|alt=]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
[[Image:ADP0002_0.jpg|link=|thumb| 400px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1355 SPI Adapter Phidget (ADP0002_0)]]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1355 SPI Adapter Phidget] allows you to interface with a wide range of SPI-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control an absolute position magnetic encoder. &lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the SPI Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following datasheet will be referenced throughout this project:&lt;br /&gt;
* [https://ams-osram.com/products/boards-kits-accessories/boards/ams-as5048a-ts-evm-ab-evaluation-board Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/f/fd/AS5048A.pdf AS5048A Encoder Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|-TkTykk1Ris|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Additional Information===&lt;br /&gt;
[[Image:Adp0002_magnet.png|link=https://cdn.phidgets.com/docs/images/2/2e/Adp0002_magnet.png|thumb]]&lt;br /&gt;
The encoder is designed to be used with a small magnet, magnetized with the poles on the edges of the cylinder instead of the top and bottom. The magnet can be attached to the exposed rear shaft of a motor, and this sensor can use the position of the magnetic field to determine the absolute position of the shaft.&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Endianness (MSB-first or LSB-first)&lt;br /&gt;
* Chip Select Polarity&lt;br /&gt;
* SPI Wire Mode&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. &lt;br /&gt;
Based on the AS5048A datasheet, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V or 5V (we&#039;ll use 5V)&lt;br /&gt;
* Communication Frequency: The clock period is 100ns minimum (10MHz maximum)&lt;br /&gt;
* Endianness: MSB-first&lt;br /&gt;
* Chip Select: Active Low&lt;br /&gt;
* SPI Wire Mode: Mode = 1&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. Some devices have certain commands that must be sent to configure the device, but this one is ready to provide sensor data as soon as it&#039;s powered up.&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_commandflow.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 11)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This diagram explains that each command we send will have its response delivered during the next transaction. Since our first goal is to get a stream of angle data from the encoder, we can just continuously send the Read Angle command. &lt;br /&gt;
&lt;br /&gt;
===Reading from AS5048A Registers===&lt;br /&gt;
&lt;br /&gt;
Commands sent to the encoder must follow the following format:&lt;br /&gt;
[[Image:SPI_command_package.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 14)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
This table tells us that the 16-bit command package consists of a parity bit, a read/write bit, and then a 14-bit register address. &lt;br /&gt;
&lt;br /&gt;
There are three data readout registers we can access. Here is the definition for the angle register:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_command_angle_readout.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 17)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The register address for the angle data is &#039;&#039;&#039;0x3FFF&#039;&#039;&#039;, but this is not the complete 16-bit value we need to transmit. First, we must add the R/W bit (Read=1) and then calculate the parity bit for even parity.&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_command_parity.png|link=|center|700px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Calculating the parity bit&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This results in &#039;&#039;&#039;0xFFFF&#039;&#039;&#039;, which is the command we need to send with the SPI Phidget.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0002 ==&lt;br /&gt;
&lt;br /&gt;
The wiring for this sensor is very straightforward with the ADP0002:&lt;br /&gt;
[[Image:SPI_encoder_pinout.png|link=|120px|left]]&lt;br /&gt;
* &#039;&#039;&#039;5V&#039;&#039;&#039; - VCC&lt;br /&gt;
* &#039;&#039;&#039;3.3V&#039;&#039;&#039; - Not connected&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Not connected&lt;br /&gt;
* &#039;&#039;&#039;SDA/CSn&#039;&#039;&#039; - CS&lt;br /&gt;
* &#039;&#039;&#039;SCL/SCK&#039;&#039;&#039; - SCLK&lt;br /&gt;
* &#039;&#039;&#039;A1/MOSI&#039;&#039;&#039; - MOSI&lt;br /&gt;
* &#039;&#039;&#039;A2/MISO&#039;&#039;&#039; - MISO&lt;br /&gt;
* &#039;&#039;&#039;GND&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_wiring_diagram.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
== Testing in the Phidget Control Panel ==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
=== Reading the Angle ===&lt;br /&gt;
&lt;br /&gt;
==== Reading the Angle in the Control Panel ====&lt;br /&gt;
Set the voltage to 5V, the chip select to Active Low, the wire mode to Mode_1, and the frequency to any value as they are all within the stated range.&lt;br /&gt;
&lt;br /&gt;
We can try sending our &#039;&#039;&#039;0xFFFF&#039;&#039;&#039; command we calculated in the previous step:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_angle_send.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
The first response is an empty &#039;&#039;&#039;0x0000&#039;&#039;&#039;, because responses are always sent in the next transaction. After that, we start getting data back from the encoder. In order to decode these values, we must go back to the datasheet and pay attention to the read package format.&lt;br /&gt;
&lt;br /&gt;
==== Decoding the Read Data Package ====&lt;br /&gt;
[[Image:SPI_read_package.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 15)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the command package, it&#039;s made up of two control bits and one 14-bit value. The control bits are a parity bit to ensure communication fidelity, and an error flag that activates if there&#039;s a problem with the previous transaction. In this example we&#039;ll ignore these bits, but in an actual deployment you&#039;d want to be checking both of these bits on each transaction.&lt;br /&gt;
&lt;br /&gt;
So to decode the response for our angle command, &#039;&#039;&#039;0x9048&#039;&#039;&#039;, we need to strip the top two bits:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_decode_response.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
This leaves us with &#039;&#039;&#039;0x1048&#039;&#039;&#039;, or 4168 in decimal. The encoder has 14-bit precision, so the formula is as follows:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;\text{Angle(°)} = \frac{\text{n}}{2^{14}} \times 360 \!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &#039;n&#039; is the response in decimal. Using this equation, our angle works out to &#039;&#039;&#039;91.58 degrees&#039;&#039;&#039;. When we eventually write our own program, we&#039;ll handle all of this bit manipulation and unit conversion in code.&lt;br /&gt;
&lt;br /&gt;
=== Zeroing the Encoder ===&lt;br /&gt;
&lt;br /&gt;
The advantage of an absolute encoder is that the actual angle of the shaft will be known as soon as the system is powered, without need for calibration or homing. This also means that the &amp;quot;home position&amp;quot; of our rotary system will be an arbitrary angle. We could zero this by keeping track of the initial angle in our program, but this chip has its own zeroing feature, so let&#039;s take a look.&lt;br /&gt;
&lt;br /&gt;
==== Zeroing Command Registers and Sequence ====&lt;br /&gt;
&lt;br /&gt;
We can find the zeroing process in the datasheet:&lt;br /&gt;
# Clear zero position registers by writing &#039;0&#039; into them&lt;br /&gt;
# Read the current angle&lt;br /&gt;
# Write the angle into the zero position registers&lt;br /&gt;
# (optional) Burn the value into the register so it persists across power cycles&lt;br /&gt;
&lt;br /&gt;
For now we&#039;ll only do the steps 2 and 3, since the zero position registers will already be zero on startup by default since we haven&#039;t burned a value into the register. In our final program we&#039;ll be using the zero as a sort of &#039;tare&#039; function so we will have to do the first step there. Here are the zero register definitions:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_zero_registers.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 17)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as before, we need to add the proper control bits to these address values before we send them.&lt;br /&gt;
* Write to Zero Position Hi: 0x0016 -&amp;gt; &#039;&#039;&#039;0x8016&#039;&#039;&#039;&lt;br /&gt;
* Write to Zero Position Lo: 0x0017 -&amp;gt; &#039;&#039;&#039;0x0017&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each of these registers, we&#039;ll follow this flow:&lt;br /&gt;
* Write to the zero position command&lt;br /&gt;
* Send the angle data&lt;br /&gt;
* Send a NOP (empty command) to confirm data sent&lt;br /&gt;
&lt;br /&gt;
==== Zeroing in the Control Panel ====&lt;br /&gt;
&lt;br /&gt;
In this example, our received data is &#039;&#039;&#039;0xBB99&#039;&#039;&#039;. Stripping the control bits, we get &#039;&#039;&#039;0x3B99&#039;&#039;&#039; or &#039;&#039;&#039;11 1011 1001 1001&#039;&#039;&#039; in binary. According to the zero register definitions, we need the 6 least significant bits in the low register, and the other 8 in the high register. This gives us:&lt;br /&gt;
&lt;br /&gt;
* LSB: &#039;&#039;&#039;0b011001&#039;&#039;&#039; &#039;&#039;&#039;(0x19)&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;0x8019&#039;&#039;&#039;&lt;br /&gt;
* MSB: &#039;&#039;&#039;0b11101110&#039;&#039;&#039; &#039;&#039;&#039;(0xEE)&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;0x00EE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Again, since we need to set the write bits and proper parity, we end up with &#039;&#039;&#039;0x8019&#039;&#039;&#039; and &#039;&#039;&#039;0x00EE&#039;&#039;&#039;. Here&#039;s what the zeroing process looks like in the control panel (annotations added for clarity):&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_controlpanel_zero.png|link=|center|850px]]&lt;br /&gt;
&lt;br /&gt;
There are no error bits set in the responses, and each register we set echoed back the correct value when we wrote to it. The angle response we got after zeroing is &#039;&#039;&#039;0xBFF7&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Strip control bits -&amp;gt; 0x3FF7&lt;br /&gt;
* Convert to decimal -&amp;gt; 16375&lt;br /&gt;
* Angle formula -&amp;gt; 359.80°&lt;br /&gt;
&lt;br /&gt;
Since our new angle is close to 360° (the same as 0°), it looks like the zeroing process was successful.&lt;br /&gt;
&lt;br /&gt;
== Writing a Custom Python Script ==&lt;br /&gt;
&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the code sample to demonstrate a simple readout of the encoder angle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def hex2angle(hex):&lt;br /&gt;
	bytes = (hex[0] &amp;lt;&amp;lt; 8) | hex[1]      # Combine MSB and LSB&lt;br /&gt;
	bytes = bytes &amp;amp; 0b0011111111111111  # Discard top two bits (parity and error flag bits)&lt;br /&gt;
	angle = round(bytes / 16348*360,3)  # Divide by 2^14, multiply by 360 to get degrees&lt;br /&gt;
	return angle&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
	# Open ADP0002&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setEndianness(DataAdapterEndianness.ENDIANNESS_MSB_FIRST)&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_1500kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_5_0V)&lt;br /&gt;
	adp.setSPIChipSelect(DataAdapterSPIChipSelect.SPI_CHIP_SELECT_ACTIVE_LOW)&lt;br /&gt;
	adp.setSPIMode(DataAdapterSPIMode.SPI_MODE_1)&lt;br /&gt;
	time.sleep(0.5)&lt;br /&gt;
&lt;br /&gt;
	# Read and print angle until keyboard interrupt&lt;br /&gt;
	print(&amp;quot;Printing encoder data. Press CTRL+C to quit.&amp;quot;)&lt;br /&gt;
	try:&lt;br /&gt;
		while True:&lt;br /&gt;
			recvData = adp.sendPacketWaitResponse([0xFF,0xFF])&lt;br /&gt;
			print(f&amp;quot;\rEncoder Angle: {hex2angle(recvData)}    &amp;quot;,end=&amp;quot;&amp;quot;,flush=True)&lt;br /&gt;
			time.sleep(0.1)&lt;br /&gt;
&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It displays the encoder angle and also provides the option to zero the encoder.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
import threading&lt;br /&gt;
&lt;br /&gt;
# Register definitions from datasheet&lt;br /&gt;
ANGLE = [0x3F,0xFF]&lt;br /&gt;
MAGNITUDE = [0x3F,0xFE]&lt;br /&gt;
DIAGNOSTIC = [0x3F,0xFD]&lt;br /&gt;
CLEAR_ERR = [0x00,0x01]&lt;br /&gt;
NOP = [0x00,0x00]&lt;br /&gt;
ZERO_POS_HI = [0x00,0x16]&lt;br /&gt;
ZERO_POS_LO = [0x00,0x17]&lt;br /&gt;
READ = 1&lt;br /&gt;
WRITE = 0&lt;br /&gt;
&lt;br /&gt;
adp = DataAdapter()&lt;br /&gt;
&lt;br /&gt;
# Listener for keypress during main loop&lt;br /&gt;
running = True&lt;br /&gt;
def keyboard_listener():&lt;br /&gt;
    global running&lt;br /&gt;
    while running:&lt;br /&gt;
        cmd = input().strip().lower()&lt;br /&gt;
        if cmd == &amp;quot;z&amp;quot;:&lt;br /&gt;
            zero()&lt;br /&gt;
        elif cmd == &amp;quot;q&amp;quot;:&lt;br /&gt;
            running = False&lt;br /&gt;
&lt;br /&gt;
# Adds the required RW and parity bits&lt;br /&gt;
def addBits(packet,rw):&lt;br /&gt;
	bits = ((packet[0] &amp;lt;&amp;lt; 8) | packet[1]) &amp;amp; 0x3FFF&lt;br /&gt;
&lt;br /&gt;
	if(rw):&lt;br /&gt;
		bits = bits | 0b0100000000000000&lt;br /&gt;
	else:&lt;br /&gt;
		bits = bits &amp;amp; 0b1011111111111111&lt;br /&gt;
&lt;br /&gt;
	if(bits.bit_count()%2 == 0):&lt;br /&gt;
		bits = bits &amp;amp; 0b0111111111111111&lt;br /&gt;
	else:&lt;br /&gt;
		bits = bits | 0b1000000000000000&lt;br /&gt;
		&lt;br /&gt;
	res = [(bits &amp;gt;&amp;gt; 8)&amp;amp; 0xFF,(bits &amp;amp; 0xFF)]&lt;br /&gt;
	return res&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def zero():&lt;br /&gt;
	# Clear zero registers - this is needed to be able to zero more than once per run&lt;br /&gt;
	adp.sendPacket(addBits(ZERO_POS_HI,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits([0x00,0x00],WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(NOP,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(ZERO_POS_LO,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits([0x00,0x00],WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
	# Read current angle&lt;br /&gt;
	adp.sendPacket(addBits(ANGLE,READ))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
	# Combine angle bytes and mask out err/parity bits&lt;br /&gt;
	angle = ((resp[0] &amp;lt;&amp;lt; 8) | resp[1]) &amp;amp; 0x3FFF&lt;br /&gt;
&lt;br /&gt;
	# Split out angle for sending to zero registers&lt;br /&gt;
	zposm = (angle &amp;gt;&amp;gt; 6) &amp;amp; 0xFF &lt;br /&gt;
	zposl = angle &amp;amp; 0x3F&lt;br /&gt;
&lt;br /&gt;
	# write ZPOSM (0x0016)&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(ZERO_POS_HI,WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits([0x00,zposm],WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
    # write ZPOSL (0x0017)&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(ZERO_POS_LO,WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits([0x00,zposl],WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
def hex2angle(hex):&lt;br /&gt;
	bytes = (hex[0] &amp;lt;&amp;lt; 8) | hex[1]      # Combine MSB and LSB&lt;br /&gt;
	bytes = bytes &amp;amp; 0b0011111111111111  # Discard top two bits (parity and error flag bits)&lt;br /&gt;
	angle = round(bytes / 16348*360,3)  # Divide by 2^14, multiply by 360 to get degrees&lt;br /&gt;
	return angle&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
	# Open ADP0002&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setEndianness(DataAdapterEndianness.ENDIANNESS_MSB_FIRST)&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_1500kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_5_0V)&lt;br /&gt;
	adp.setSPIChipSelect(DataAdapterSPIChipSelect.SPI_CHIP_SELECT_ACTIVE_LOW)&lt;br /&gt;
	adp.setSPIMode(DataAdapterSPIMode.SPI_MODE_1)&lt;br /&gt;
	time.sleep(0.5)&lt;br /&gt;
&lt;br /&gt;
	# Start thread for keypress detection during the loop&lt;br /&gt;
	threading.Thread(target=keyboard_listener, daemon=True).start()&lt;br /&gt;
	print(&amp;quot;Printing encoder data. Press &#039;z&#039; to zero and &#039;q&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	# Read and print angle until &#039;q&#039; pressed&lt;br /&gt;
	try:&lt;br /&gt;
		while running:&lt;br /&gt;
			recvData = adp.sendPacketWaitResponse(addBits(ANGLE,READ))&lt;br /&gt;
			print(f&amp;quot;\rEncoder Angle: {hex2angle(recvData)}    &amp;quot;,end=&amp;quot;&amp;quot;,flush=True)&lt;br /&gt;
			time.sleep(0.1)&lt;br /&gt;
&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Adp0002_spiencoder_primary.png&amp;diff=35622</id>
		<title>File:Adp0002 spiencoder primary.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Adp0002_spiencoder_primary.png&amp;diff=35622"/>
		<updated>2026-04-15T15:48:35Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Reading_an_I2C_Color_Sensor&amp;diff=35621</id>
		<title>Reading an I2C Color Sensor</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Reading_an_I2C_Color_Sensor&amp;diff=35621"/>
		<updated>2026-04-15T15:46:47Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=I2C Adapter}}&lt;br /&gt;
{{#seo:|description=Read an I2C color sensor with the I2C Adapter Phidget}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:Adp0001_rgbcolor_primary.png|thumb|link=|alt=]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to read data from an RGB Color Sensor.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resource will be referenced throughout this project.&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/1/13/TCS34725.pdf TCS34725 RGB Color Sensor IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|dYREkxXgjEA|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_rgb_specs2.png|link=https://cdn.phidgets.com/docs/images/0/05/Adp0002_rgb_specs2.png|thumb|&amp;lt;center&amp;gt;Excerpts from Datasheet&amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or datasheet. In this case, it was all found on pages 3 to 5 of the datasheet:&lt;br /&gt;
* Supply Voltage: 3.3V&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x29&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The TCS34725 datasheet provides a state diagram that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_states.png|link=https://cdn.phidgets.com/docs/images/0/0e/Adp0002_rgb_states.png|200px|right|thumb|&amp;lt;center&amp;gt;From datasheet (page 7)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the state diagram, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable PON (power on) to go from sleep to idle state&lt;br /&gt;
# Enable AEN (RGB enabled) to go from idle to RGBC state&lt;br /&gt;
&lt;br /&gt;
After these steps, the device should be able to provide data and respond to commands. We&#039;re not using WEN (wait enabled) since we don&#039;t need this power-saving feature at this time.&lt;br /&gt;
&lt;br /&gt;
===Writing to TCS34725 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This protocol diagram from page 12 of the datasheet confirms that the TCS34725 behaves as expected:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_protocol.png|link=https://cdn.phidgets.com/docs/images/3/38/Adp0002_rgb_protocol.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The Start (S), Stop (P), Acknowledge (A), and W/R (Write/Read) is all handled internally by the I2C Phidget, so we just need to focus on the command code and data. &lt;br /&gt;
&lt;br /&gt;
==== Command Register ====&lt;br /&gt;
&lt;br /&gt;
The command register lets us tell the sensor which register we want to read or write on our next communication. &lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdreg.png|link=https://cdn.phidgets.com/docs/images/0/0d/Adp0002_rgb_cmdreg.png|750px|center]]&lt;br /&gt;
&lt;br /&gt;
* The first bit is always &#039;1&#039;&lt;br /&gt;
* The next two bits control the how the device behaves when requesting multiple bytes&lt;br /&gt;
* The last five bits hold the register address (we can ignore the special functions for this project)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an abridged list of registers we&#039;ll be using:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_registers.png|link=https://cdn.phidgets.com/docs/images/4/48/Adp0002_rgb_registers.png|600px|center]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the Sensor====&lt;br /&gt;
Enable is managed by register &#039;&#039;&#039;0x00&#039;&#039;&#039;, so our command register will look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdenable.png|link=https://cdn.phidgets.com/docs/images/0/03/Adp0002_rgb_cmdenable.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
So we&#039;ll send &#039;&#039;&#039;0x80&#039;&#039;&#039; to select the enable register.&lt;br /&gt;
&lt;br /&gt;
The enable register is defined in the datasheet as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_enablereg.png|link=https://cdn.phidgets.com/docs/images/8/89/Adp0002_rgb_enablereg.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
* Bits 5, 6, and 7 are &#039;&#039;&#039;000&#039;&#039;&#039;, as they&#039;re reserved&lt;br /&gt;
* Bit 4 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not using interrupts&lt;br /&gt;
* Bit 3 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not using the wait feature&lt;br /&gt;
* Bit 2 is &#039;&#039;&#039;0&#039;&#039;&#039;, as it&#039;s reserved&lt;br /&gt;
* Bit 1 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not enabling RGBC yet&lt;br /&gt;
* Bit 0 will be &#039;&#039;&#039;1&#039;&#039;&#039;, to enable power&lt;br /&gt;
&lt;br /&gt;
That gives us &#039;&#039;&#039;0x01&#039;&#039;&#039;. Together with our command register, our first communication will be &#039;&#039;&#039;0x8001&#039;&#039;&#039;.&lt;br /&gt;
The reason we don&#039;t enable RGBC yet is because the device requires a 2.4ms delay between PON and RGBC for reliable startup.&lt;br /&gt;
&lt;br /&gt;
====Enable RGBC====&lt;br /&gt;
&lt;br /&gt;
To enable RGBC we will use the same command we used for power on, but both the AEN bit and the PON bit will be 1. This gives us &#039;&#039;&#039;0x8003&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Reading Data ===&lt;br /&gt;
&lt;br /&gt;
Now that the sensor is initialized, we can start getting data from it. We want to read all eight color registers, so we need to set auto-increment in the command register and point it to the first color register which is at 0x14:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdreadauto.png|link=https://cdn.phidgets.com/docs/images/8/87/Adp0002_rgb_cmdreadauto.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
This means we need to send &#039;&#039;&#039;B4&#039;&#039;&#039;. After that, we can listen for 8 bytes at a time to get all of our color data.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
The pinout for this sensor is printed on the PCB:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_rgb_pinout2.png|link=|130px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;VIN&#039;&#039;&#039; - Power&lt;br /&gt;
*&#039;&#039;&#039;GND&#039;&#039;&#039; - Ground&lt;br /&gt;
*&#039;&#039;&#039;3V3&#039;&#039;&#039; - 3.3V Output &lt;br /&gt;
*&#039;&#039;&#039;SCL&#039;&#039;&#039; - Serial Clock&lt;br /&gt;
*&#039;&#039;&#039;SDA&#039;&#039;&#039; - Serial Data&lt;br /&gt;
*&#039;&#039;&#039;INT&#039;&#039;&#039; - Interrupt&lt;br /&gt;
*&#039;&#039;&#039;LED&#039;&#039;&#039; - LED toggle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need the 3.3V output or the interrupt pin for this project. The other pins can be connected to the ADP0001 as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_rgb_connection.png|800px|link=https://cdn.phidgets.com/docs/images/d/d9/I2C_rgb_connection.png]]&lt;br /&gt;
&lt;br /&gt;
The LED toggle pin is connected to one of the ADP0001&#039;s GPIO pins so we can use it to turn off the LED when not in use.&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the command sequence and our sensor connected, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x29.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel.png|link=https://cdn.phidgets.com/docs/images/2/20/I2C_RGB_ControlPanel.png|center]]&lt;br /&gt;
&lt;br /&gt;
Now we can enable the sensor with our command sequence:&lt;br /&gt;
* 0x8001 (Power on)&lt;br /&gt;
* 0x8003 (RGBC on)&lt;br /&gt;
* 0xB4 (auto increment and start from register 0x14)&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/4/4f/I2C_RGB_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Reading Data===&lt;br /&gt;
After sending the command register B4, we can read all color registers by reading 8 bytes at a time.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel3.png|link=https://cdn.phidgets.com/docs/images/0/0a/I2C_RGB_ControlPanel3.png|center]]&lt;br /&gt;
[[Image:I2C_RGB_responsegraph.png|link=https://wwwdev.int.phidgets.com/docs/images/9/97/I2C_RGB_responsegraph.png|thumb|&amp;lt;center&amp;gt;Sensor response characteristic (pg.6)&amp;lt;center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This sensor ultimately provides us with four 16-bit values: Clear, Red, Green, and Blue. The clear light value is important for providing brightness calibration. Since the responses of the red, green and blue sensors are normalized to match the response of the clear sensor, we can use it as a baseline to determine color in both bright and dim environments. &lt;br /&gt;
&lt;br /&gt;
In the above image, we get roughly the same value when polling the sensor three times, so the value seems stable. We&#039;ll use the bottom row to see if the color makes sense. The data bytes received are sent in register order, so our values are:&lt;br /&gt;
&lt;br /&gt;
* Clear: 0x0FFD&lt;br /&gt;
* Red: 0x0A96&lt;br /&gt;
* Green: 0x0331&lt;br /&gt;
* Blue: 0x0271&lt;br /&gt;
&lt;br /&gt;
Converting to decimal, that&#039;s 4093, 2710, 817, 625. We can normalize the last three values using the clear value, and then multiply by 255 and round to get a standard RGB value:&lt;br /&gt;
&lt;br /&gt;
* Red:   (2710/4093)*255 = 169&lt;br /&gt;
* Green: (817/4093)*255  = 51&lt;br /&gt;
* Blue:  (625/4093)*255  = 39&lt;br /&gt;
&lt;br /&gt;
This RGB value &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:#A93327&amp;quot;&amp;gt;(#A93327)&amp;lt;/span&amp;gt;&#039;&#039;&#039; looks to be correct, as the sensor was pointed at a roll of red electrical tape. &lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the Python code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def convert_rgbc(data):&lt;br /&gt;
&lt;br /&gt;
	c = data[1] &amp;lt;&amp;lt; 8 | data[0]&lt;br /&gt;
&lt;br /&gt;
	if(c &amp;lt;= 0):&lt;br /&gt;
		return [0,0,0]&lt;br /&gt;
&lt;br /&gt;
	# Combine high and low bytes for each color,&lt;br /&gt;
	# Then normalize and cap at 255&lt;br /&gt;
	r = min(255,round((data[3] &amp;lt;&amp;lt; 8 | data[2]) / c * 255))&lt;br /&gt;
	g = min(255,round((data[5] &amp;lt;&amp;lt; 8 | data[4]) / c * 255))&lt;br /&gt;
	b = min(255,round((data[7] &amp;lt;&amp;lt; 8 | data[6]) / c * 255))&lt;br /&gt;
	return [r,g,b]&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x29&lt;br /&gt;
&lt;br /&gt;
	# Power On&lt;br /&gt;
	adp.i2cSendReceive(addr, [0x8001], 0)&lt;br /&gt;
	time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
	# RGBC On&lt;br /&gt;
	adp.i2cSendReceive(addr, [0x8003], 0)&lt;br /&gt;
&lt;br /&gt;
	# Auto-increment starting with CDATAL&lt;br /&gt;
	adp.i2cSendReceive(addr, [0xB4], 0)&lt;br /&gt;
&lt;br /&gt;
	try:&lt;br /&gt;
		while True:&lt;br /&gt;
			rgb = convert_rgbc(adp.i2cSendReceive(addr, [], 8))&lt;br /&gt;
			print(&amp;quot;R: &amp;quot; + str(rgb[0]) + &amp;quot;   G: &amp;quot; + str(rgb[1]) + &amp;quot;   B: &amp;quot; + str(rgb[2]))&lt;br /&gt;
			time.sleep(0.5)&lt;br /&gt;
			pass&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		print(&amp;quot;Closing...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Python Graphical Example===&lt;br /&gt;
Here is a more in-depth script that displays a graph of the raw values and shows the calculated color after gamma and saturation adjustment. &lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
import tkinter as tk&lt;br /&gt;
import math&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
class MultiLineGraph(tk.Canvas):&lt;br /&gt;
    def __init__(self, parent, lines=4, max_points=100, **kwargs):&lt;br /&gt;
        super().__init__(parent, bg=&amp;quot;black&amp;quot;, **kwargs)&lt;br /&gt;
        self.lines = lines&lt;br /&gt;
        self.max_points = max_points&lt;br /&gt;
        self.data = [[] for _ in range(lines)]&lt;br /&gt;
        self.colors = [&amp;quot;white&amp;quot;, &amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;, &amp;quot;blue&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    def add_points(self, *values):&lt;br /&gt;
        for i, v in enumerate(values):&lt;br /&gt;
            self.data[i].append(v)&lt;br /&gt;
            if len(self.data[i]) &amp;gt; self.max_points:&lt;br /&gt;
                self.data[i].pop(0)&lt;br /&gt;
        self.draw()&lt;br /&gt;
&lt;br /&gt;
    def draw(self):&lt;br /&gt;
        self.delete(&amp;quot;all&amp;quot;)&lt;br /&gt;
        w = self.winfo_width()&lt;br /&gt;
        h = self.winfo_height()&lt;br /&gt;
&lt;br /&gt;
        if w &amp;lt; 10 or h &amp;lt; 10:&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        # Flatten all visible data&lt;br /&gt;
        all_values = [v for line in self.data for v in line]&lt;br /&gt;
&lt;br /&gt;
        if not all_values:&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        min_val = min(all_values)&lt;br /&gt;
        max_val = max(all_values)&lt;br /&gt;
&lt;br /&gt;
        # Prevent divide-by-zero&lt;br /&gt;
        if max_val == min_val:&lt;br /&gt;
            max_val += 1&lt;br /&gt;
&lt;br /&gt;
        padding = (max_val - min_val) * 0.1  # 10% padding&lt;br /&gt;
        min_val -= padding&lt;br /&gt;
        max_val += padding&lt;br /&gt;
&lt;br /&gt;
        for i, line in enumerate(self.data):&lt;br /&gt;
            if len(line) &amp;lt; 2:&lt;br /&gt;
                continue&lt;br /&gt;
&lt;br /&gt;
            points = []&lt;br /&gt;
            for j, val in enumerate(line):&lt;br /&gt;
                x = j / (self.max_points - 1) * w&lt;br /&gt;
&lt;br /&gt;
                # Normalize to 0–1&lt;br /&gt;
                norm = (val - min_val) / (max_val - min_val)&lt;br /&gt;
&lt;br /&gt;
                # Flip Y (Tkinter origin is top-left)&lt;br /&gt;
                y = h - (norm * h)&lt;br /&gt;
&lt;br /&gt;
                points.extend([x, y])&lt;br /&gt;
&lt;br /&gt;
            self.create_line(points, fill=self.colors[i], width=2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class App:&lt;br /&gt;
    def __init__(self, root):&lt;br /&gt;
        self.root = root&lt;br /&gt;
        self.root.title(&amp;quot;I2C RGB Viewer&amp;quot;)&lt;br /&gt;
        self.adp = DataAdapter()&lt;br /&gt;
        self.addr = 0x29&lt;br /&gt;
        self.sat = 1.8&lt;br /&gt;
        self.gamma = 1.3&lt;br /&gt;
&lt;br /&gt;
        # --- Define Gamma Table ---&lt;br /&gt;
        self.gamma_table = [0] * 256&lt;br /&gt;
        for i in range(256):&lt;br /&gt;
            self.gamma_table[i] = int(math.pow(i/255.0,self.gamma)*255)&lt;br /&gt;
&lt;br /&gt;
        # --- UI ---&lt;br /&gt;
        self.graph = MultiLineGraph(root, height=300)&lt;br /&gt;
        self.graph.pack(fill=&amp;quot;both&amp;quot;, expand=True)&lt;br /&gt;
&lt;br /&gt;
        self.rgb_entry = tk.Entry(root, font=(&amp;quot;Consolas&amp;quot;, 14))&lt;br /&gt;
        self.rgb_entry.pack(fill=&amp;quot;x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        self.color_panel = tk.Frame(root, height=50, bg=&amp;quot;black&amp;quot;)&lt;br /&gt;
        self.color_panel.pack(fill=&amp;quot;x&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
        self.adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
        # Set properties&lt;br /&gt;
        self.adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
        self.adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
&lt;br /&gt;
        # Power On&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0x8001], 0)&lt;br /&gt;
        time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
        # RGBC On&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0x8003], 0)&lt;br /&gt;
&lt;br /&gt;
        # Auto-increment starting with CDATAL&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0xB4], 0)&lt;br /&gt;
&lt;br /&gt;
        # --- Timer ---&lt;br /&gt;
        self.update_loop()&lt;br /&gt;
&lt;br /&gt;
    def read_sensor(self):&lt;br /&gt;
        &lt;br /&gt;
        data = self.adp.i2cSendReceive(self.addr, [], 8)&lt;br /&gt;
&lt;br /&gt;
        # Combine high and low bytes for clear register&lt;br /&gt;
        raw_c = data[1] &amp;lt;&amp;lt; 8 | data[0]&lt;br /&gt;
&lt;br /&gt;
        if(raw_c &amp;lt;= 0):&lt;br /&gt;
            return [0,0,0,0]&lt;br /&gt;
&lt;br /&gt;
        # Combine high and low bytes for each colour&lt;br /&gt;
        raw_r = data[3] &amp;lt;&amp;lt; 8 | data[2]&lt;br /&gt;
        raw_g = data[5] &amp;lt;&amp;lt; 8 | data[4]&lt;br /&gt;
        raw_b = data[7] &amp;lt;&amp;lt; 8 | data[6]&lt;br /&gt;
&lt;br /&gt;
        return raw_c, raw_r, raw_g, raw_b&lt;br /&gt;
&lt;br /&gt;
    def update_loop(self):&lt;br /&gt;
        raw_c, raw_r, raw_g, raw_b = self.read_sensor()&lt;br /&gt;
&lt;br /&gt;
        if raw_c &amp;gt; 0:&lt;br /&gt;
            # Normalize + gamma&lt;br /&gt;
            norm_r = self.gamma_table[int(raw_r / raw_c * 255)]&lt;br /&gt;
            norm_g = self.gamma_table[int(raw_g / raw_c * 255)]&lt;br /&gt;
            norm_b = self.gamma_table[int(raw_b / raw_c * 255)]&lt;br /&gt;
&lt;br /&gt;
            avg = (norm_r + norm_g + norm_b) / 3&lt;br /&gt;
&lt;br /&gt;
            # Saturation adjust&lt;br /&gt;
            norm_r = max(0, min(255, avg + (norm_r - avg) * self.sat))&lt;br /&gt;
            norm_g = max(0, min(255, avg + (norm_g - avg) * self.sat))&lt;br /&gt;
            norm_b = max(0, min(255, avg + (norm_b - avg) * self.sat))&lt;br /&gt;
&lt;br /&gt;
            hex_color = &amp;quot;#{:02X}{:02X}{:02X}&amp;quot;.format(&lt;br /&gt;
                int(norm_r), int(norm_g), int(norm_b)&lt;br /&gt;
            )&lt;br /&gt;
&lt;br /&gt;
            self.rgb_entry.delete(0, tk.END)&lt;br /&gt;
            self.rgb_entry.insert(0, hex_color)&lt;br /&gt;
&lt;br /&gt;
            self.color_panel.config(bg=hex_color)&lt;br /&gt;
&lt;br /&gt;
        # Update graph&lt;br /&gt;
        self.graph.add_points(raw_c, raw_r, raw_g, raw_b)&lt;br /&gt;
&lt;br /&gt;
        # Repeat every 50 ms&lt;br /&gt;
        self.root.after(50, self.update_loop)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    root = tk.Tk()&lt;br /&gt;
    app = App(root)&lt;br /&gt;
    root.geometry(&amp;quot;600x400&amp;quot;)&lt;br /&gt;
    root.mainloop()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Adp0001_rgbcolor_primary.png&amp;diff=35620</id>
		<title>File:Adp0001 rgbcolor primary.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Adp0001_rgbcolor_primary.png&amp;diff=35620"/>
		<updated>2026-04-15T15:46:22Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=LEDArray_API_Guide&amp;diff=35619</id>
		<title>LEDArray API Guide</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=LEDArray_API_Guide&amp;diff=35619"/>
		<updated>2026-04-15T15:34:14Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:IntroGuide]]&lt;br /&gt;
{{#seo:|keywords=Addressable LED}}&lt;br /&gt;
{{#seo:|description=Get started with your Addressable LED Phidget}}&lt;br /&gt;
&amp;lt;div class=&amp;quot;nonumtoc&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toclimit-4&amp;quot;&amp;gt;&lt;br /&gt;
=Introduction=&lt;br /&gt;
This guide will provide information about the LEDArray API to get you up and running with your new Addressable LED Phidget.&lt;br /&gt;
&lt;br /&gt;
=LEDArray API Overview=&lt;br /&gt;
==Phidget Control Panel==&lt;br /&gt;
After wiring your Addressable LED Phidget using the Quick Start Guide on the product page, we recommend opening the [https://www.phidgets.com/docs/Phidget_Control_Panel Phidget Control Panel] on a Windows computer to experiment with key features.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:LED0100_ControlPanel.png|center|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the Addressable LED Phidget is plugged in via USB or VINT, it will appear up on the Phidget Control Panel device list as shown above. Double-click on the entry to view the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:LED0100_ControlPanelExample2.jpg|center|link=https://cdn.phidgets.com/docs/images/3/3e/LED0100_ControlPanelExample2.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening the program, you will see the screen shown above. The program is split into multiple sections to help you get familiar with your controller.&lt;br /&gt;
#Phidget Info&lt;br /&gt;
#Configuration&lt;br /&gt;
#Basic/Advanced Tabs&lt;br /&gt;
In this guide, we will focus on the areas that contain important information about controlling your LEDs. For information about the Phidget Info section, and the Phidget Control Panel in general, visit our [https://www.phidgets.com/docs/Phidget_Control_Panel Phidget Control Panel] Page.&lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
===Color Order===&lt;br /&gt;
[[Image:Ledarray_colororder_addressableLED.png|thumb|400px|link=https://cdn.phidgets.com/docs/images/1/19/Ledarray_colororder_addressableLED.png|&amp;lt;center&amp;gt;Illustration of a RGBW Addressable LED&amp;lt;center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Addressable LEDs consist of red, green, blue, and sometimes white LEDs, as shown in the illustration on the right.&lt;br /&gt;
&lt;br /&gt;
To control these LEDs, the LED chip must receive data from the Addressable LED Phidget in a specific order. The most common sequences are:&lt;br /&gt;
* RGB&lt;br /&gt;
* GRB&lt;br /&gt;
* RGBW&lt;br /&gt;
* GRBW&lt;br /&gt;
&lt;br /&gt;
Refer to the product page or datasheet of your addressable LEDs to determine which sequence is used, and configure your controller accordingly using this property.&lt;br /&gt;
&lt;br /&gt;
===Gamma===&lt;br /&gt;
The brightness of an LED increases linearly with current, however, the human eye perceives this brightness in a non-linear fashion. The Addressable LED Phidget includes built-in gamma correction to compensate for this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The default value of this property is 2.2, which matches most computer displays.&lt;br /&gt;
&lt;br /&gt;
===Brightness===&lt;br /&gt;
Apply a brightness value to all LEDs.&lt;br /&gt;
&lt;br /&gt;
====Other Considerations====&lt;br /&gt;
Increasing the brightness of your LEDs will increase their current draw. Ensure you are using an appropriately sized power supply.&lt;br /&gt;
&lt;br /&gt;
===PowerEnabled===&lt;br /&gt;
Control the power to your LEDs with this property.&lt;br /&gt;
&lt;br /&gt;
====Other Considerations====&lt;br /&gt;
If an [[#Over Current|Over Current]] error event occurs, you must toggle Power Enabled to resume operation.&lt;br /&gt;
&lt;br /&gt;
===Clear===&lt;br /&gt;
This will turn off all LEDs. It will also stop any [[#Animations|animations]].&lt;br /&gt;
&lt;br /&gt;
==Basic Tab==&lt;br /&gt;
The basic tab uses the {{Code|setLEDs}} method to apply a single color to the LEDs specified by the start and end addresses.&lt;br /&gt;
&lt;br /&gt;
===Other Considerations===&lt;br /&gt;
The {{Code|MinAddress}} is 0, and the {{Code|MaxAddress}} is 2047 for this controller. This means you can control up to 2048 LEDs, which is specified by the {{Code|MaxLEDCount}} property. &lt;br /&gt;
&lt;br /&gt;
If you are using addressable LEDs with a white component (e.g., RGBW), the {{Code|MaxAddress}} is reduced to 1535 and the {{Code|MaxLEDCount}} is reduced to 1536.&lt;br /&gt;
&lt;br /&gt;
==Advanced Tab==&lt;br /&gt;
The advanced tab also uses the {{Code|setLEDs}} method, however, it exposes extra parameters to experiment with.&lt;br /&gt;
&lt;br /&gt;
===LED Pattern===&lt;br /&gt;
The LED Pattern selector can be used to define a color pattern that can be sent to the controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Ledarray_ledarraycolor_selector.jpg|center|link=https://cdn.phidgets.com/docs/images/9/92/Ledarray_ledarraycolor_selector.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is equivalent to the following {{Code|LEDArrayColor}} array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&#039;CSharp&#039;&amp;gt;&lt;br /&gt;
//C#&lt;br /&gt;
LEDArrayColor[] exampleArray = new LEDArrayColor[2];&lt;br /&gt;
exampleArray[0].B = 255;&lt;br /&gt;
exampleArray[1].G = 255;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This pattern will repeat if it is shorter than the total number of LEDs being controlled, as defined by the start and end addresses. For example, if the start address is set to 0 and the end address to 7, we would see the following result:&lt;br /&gt;
&lt;br /&gt;
[[Image:ledarray_ledpattern_bluegreen4.png|center|800px|link=https://cdn.phidgets.com/docs/images/7/77/Ledarray_ledpattern_bluegreen4.png]]&lt;br /&gt;
&lt;br /&gt;
Conversely, if the pattern is longer than the total number of LEDs being controlled, it will be truncated.&lt;br /&gt;
&lt;br /&gt;
===Fade Time===&lt;br /&gt;
If a fade time is defined, the controller will smoothly fade the LED from its previous state to its new state.&lt;br /&gt;
&lt;br /&gt;
===Other Considerations===&lt;br /&gt;
The {{Code|MinAddress}} is 0, and the {{Code|MaxAddress}} is 2047 for this controller. This means you can control up to 2048 LEDs, which is specified by the {{Code|MaxLEDCount}} property. &lt;br /&gt;
&lt;br /&gt;
If you are using addressable LEDs with a white component (e.g., RGBW), the {{Code|MaxAddress}} is reduced to 1535 and the {{Code|MaxLEDCount}} is reduced to 1536.&lt;br /&gt;
&lt;br /&gt;
==Animations==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|dJqAxyxWizY|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Addressable LED Phidget can perform various animations on board. &lt;br /&gt;
&lt;br /&gt;
===Animation Type===&lt;br /&gt;
There are five animation types:&lt;br /&gt;
* ForwardScroll&lt;br /&gt;
* ReverseScroll&lt;br /&gt;
* ForwardScrollMirror&lt;br /&gt;
* ReverseScrollMirror&lt;br /&gt;
* Randomize&lt;br /&gt;
&lt;br /&gt;
===Animation Slot===&lt;br /&gt;
Up to 16 animations can run concurrently. The animation slot (animation ID) is used when setting and stopping an animation.&lt;br /&gt;
&lt;br /&gt;
===Start/End Address===&lt;br /&gt;
Define the range of your animation. Animations cannot overlap.&lt;br /&gt;
&lt;br /&gt;
===Time===&lt;br /&gt;
Define the time between changes in milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Other Considerations===&lt;br /&gt;
Animations can be especially useful when paired with [{{SERVER}}/docs/Channel_Persistence_Guide Channel Persistence], as they are executed directly by the controller and can continue running even after the software application is no longer active.&lt;br /&gt;
&lt;br /&gt;
==Errors==&lt;br /&gt;
===Over Current===&lt;br /&gt;
Addressable LEDs can demand significant power, especially when many LEDs are used at high brightness. The Addressable LED Phidget intelligently monitors current draw and will shut off power when the following limits are exceeded:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto;width:75%;text-align:center&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | Power Source&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | Current Limit (mA)&lt;br /&gt;
|-&lt;br /&gt;
| USB || 800&lt;br /&gt;
|-&lt;br /&gt;
| External (Power Jack) || 3200&lt;br /&gt;
|-&lt;br /&gt;
| External (Direct to LEDs) || N/A*&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;The Addressable LED Phidget can only monitor current draw when the LEDs are powered via USB or the onboard power jack. If the LEDs are powered directly, they are not protected by the onboard fuse or current monitoring circuitry. In these situations, the user is responsible for implementing adequate overcurrent protection to prevent damage or injury.&lt;br /&gt;
&lt;br /&gt;
====Other Considerations====&lt;br /&gt;
If an &#039;&#039;&#039;OverCurrent&#039;&#039;&#039; error occurs, you will need to toggle [[#Power Enabled|Power Enabled]] to resume operation.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35618</id>
		<title>Controlling an I2C Display</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35618"/>
		<updated>2026-04-15T15:32:32Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=I2C Adapter}}&lt;br /&gt;
{{#seo:|description=Control an 14-segment LCD display with the I2C Adapter Phidget}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;display:none;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:I2C_Sensor_Phid.png|thumb|link=|alt=]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control a 14-segment alphanumeric display.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resources will be referenced throughout this project.&lt;br /&gt;
* [https://www.sparkfun.com/sparkfun-qwiic-alphanumeric-display-red.html Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/7/7b/VK16K33.pdf VK16K33 LED Driver IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|x2YtRTRMybw|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_an_productpage2.png|link=https://cdn.phidgets.com/docs/images/2/26/Adp0002_an_productpage2.png|thumb|&amp;lt;center&amp;gt;Product page features&amp;lt;/center&amp;gt;]]&lt;br /&gt;
[[Image:I2C_Sensor_Freq.png|thumb|link=https://cdn.phidgets.com/docs/images/5/59/I2C_Sensor_Freq.png|&amp;lt;center&amp;gt;VK16K33 datasheet (Page 29)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. Based on these resources, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V*&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&#039;&#039;The datasheet specifies an operating voltage of 4.5-5V, however, this applies only when the chip is powered directly. The breakout board includes an onboard 3.3V to 5V boost circuit, which provides the required operating voltage for the chip.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The VK16K33 datasheet provides flowcharts that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_flow.png|link=https://cdn.phidgets.com/docs/images/a/a8/Adp0002_an_flow.png|750px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Adapted from datasheet (page 26)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the flowcharts, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable the internal system clock&lt;br /&gt;
# Set the dimming register&lt;br /&gt;
# Set the blinking register&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &#039;&#039;The ROW/INT step is ignored because the feature is not being used.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Display Steps&#039;&#039;&#039;&lt;br /&gt;
# Set the write address&lt;br /&gt;
# Send the data to display&lt;br /&gt;
# Turn on the display&lt;br /&gt;
&lt;br /&gt;
===Writing to VK16K33 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The VK16K33 instead expects the following format, where the register address and data is combined into a single byte:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_VK16K33comms4.png|link=https://cdn.phidgets.com/docs/images/c/c5/Adp0002_an_VK16K33comms4.png|400px]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the System Clock====&lt;br /&gt;
The system clock (oscillator) is managed by register &#039;&#039;&#039;0x20&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_SysClock.png|link=https://cdn.phidgets.com/docs/images/d/d7/I2C_Sensor_SysClock.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 7)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This register only has one relevant bit, the &#039;&#039;&#039;S&#039;&#039;&#039; bit in position &#039;&#039;&#039;D8&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;0010 0001&#039;&#039;&#039; (0x21 in hexadecimal), the system clock will be enabled. Bits marked with an &#039;&#039;&#039;X&#039;&#039;&#039; are irrelevant and can be set to either 0 or 1 with no impact.&lt;br /&gt;
&lt;br /&gt;
====Set Dimming Register====&lt;br /&gt;
Dimming is managed by register &#039;&#039;&#039;0xEF&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_dimmingreg.png|link=https://cdn.phidgets.com/docs/images/3/30/Adp0002_an_dimmingreg.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 25)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The register has four relevant bits, &#039;&#039;&#039;P0 through P3&#039;&#039;&#039;, in positions &#039;&#039;&#039;D8 through D11&#039;&#039;&#039;. These bits are used to set the duty cycle of the display, which allows for fine control of brightness. By sending the command &#039;&#039;&#039;1110 1111&#039;&#039;&#039; (0xEF in hexadecimal), maximum brightness is selected.&lt;br /&gt;
&lt;br /&gt;
====Set Blinking Register====&lt;br /&gt;
The blinking frequency and display state is managed by register &#039;&#039;&#039;0x80&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Blink.png|link=|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 9&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three relevant bits in this register: &#039;&#039;&#039;D&#039;&#039;&#039;, &#039;&#039;&#039;B0&#039;&#039;&#039;, and &#039;&#039;&#039;B1&#039;&#039;&#039; in positions &#039;&#039;&#039;D8 through D10&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;1000 0001&#039;&#039;&#039; (0x81 in hexadecimal), the display will be turned on, and blinking will be set to off.&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
====Set the Write Address====&lt;br /&gt;
The display RAM is 16 bytes and begins at address &#039;&#039;&#039;0x00&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_ram.png|link=https://cdn.phidgets.com/docs/images/b/bd/Adp0002_an_ram.png|center|750px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 10&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Send Data to Display====&lt;br /&gt;
The VK16K33 datasheet explains how the sent data translates into certain segments being activated. This is outside the scope of this project, so for the sake of simplicity, we will skip the conversion. A full code sample is provided later in this project and can be reviewed for more information.&lt;br /&gt;
&lt;br /&gt;
====Turn On Display====&lt;br /&gt;
The display was previously turned on during the Power On Steps, so this step can be ignored.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
We don&#039;t have a cable handy for the connectors on this display, so we soldered wires directly to the exposed I2C pads. The product page for the display board provides the following pinout:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pads2.png|link=|75px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;C&#039;&#039;&#039; - SCL&lt;br /&gt;
*&#039;&#039;&#039;D&#039;&#039;&#039; - SDA&lt;br /&gt;
*&#039;&#039;&#039;3&#039;&#039;&#039; - 3.3V&lt;br /&gt;
*&#039;&#039;&#039;G&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can simply wire each of these to their corresponding terminal on the I2C Adapter Phidget. Note that your device&#039;s SCL may be labeled &amp;quot;SCK&amp;quot;, and the SDA pin may be &amp;quot;DIN&amp;quot; depending on which naming convention is used.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pinout.png|800px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x70. We can then queue up the commands we determined in the previous step.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/c/c9/I2C_Sensor_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
Since we have not sent any data to the RAM yet, the segments are uninitialized, with some on and some off:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_UnInit.png|800px|link=https://cdn.phidgets.com/docs/images/8/8c/I2C_Sensor_UnInit.png]]&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
To make the screen display &#039;&#039;&#039;PHID&#039;&#039;&#039;, we will first clear the screen with the following command:&lt;br /&gt;
*&#039;&#039;&#039;0x0000000000000000000000000000&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
We can then send the following data: &lt;br /&gt;
*&#039;&#039;&#039;0x003D000B00CA000C000300C30003&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Multisend.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now see the expected result:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Phid.png|800px|link=https://cdn.phidgets.com/docs/images/c/cd/I2C_Sensor_Phid.png]]&lt;br /&gt;
&lt;br /&gt;
===Reading Display RAM===&lt;br /&gt;
This display also supports reading the RAM, so you can programmatically know what&#039;s currently showing on the display. For most devices, this is as simple as providing the proper command and specifying a number of expected reply bytes. In this case, the device is expecting a stop condition in between the command and the data, as shown by the &#039;P&#039; in the third block in this diagram:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Read.png|850px|link=https://cdn.phidgets.com/docs/images/b/b4/I2C_Sensor_Read.png|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;From page 23 of the datasheet&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to replicate this in the control panel, we must send &#039;&#039;&#039;0x00&#039;&#039;&#039; first, and then send again with no data to listen for our reply bytes. &lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Panel_Read.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the Python code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    clear = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]&lt;br /&gt;
    phid = [0x00,0x3D,0x00,0x0B,0x00,0xCA,0x00,0x0C,0x00,0x03,0x00,0xC3,0x00,0x03]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp = DataAdapter()&lt;br /&gt;
    adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Set properties&lt;br /&gt;
    adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
    adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
    addr = 0x70&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Clear Screen&lt;br /&gt;
    adp.i2cSendReceive(addr, clear, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Initialize display&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Print PHID&lt;br /&gt;
    adp.i2cSendReceive(addr, phid, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        input(&amp;quot;Press Enter to Stop\n&amp;quot;)&lt;br /&gt;
    except (Exception, KeyboardInterrupt):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It will take input from the console and print scrolling messages on the display.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
ram = [&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
#   _ _ _ b _ _ _ &lt;br /&gt;
# | \     |     / |&lt;br /&gt;
# |  c    e    g  |&lt;br /&gt;
# l   \   |   /   d&lt;br /&gt;
# |    \  |  /    |&lt;br /&gt;
# | _ n _ _ _ a _ |&lt;br /&gt;
# |    /  |  \    |&lt;br /&gt;
# j   /   |   \   f&lt;br /&gt;
# |  m    k    i  |&lt;br /&gt;
# | /     |     \ |&lt;br /&gt;
# | _ _ _ h _ _ _ |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
letters = {&lt;br /&gt;
	#      abcdefghijklmn         abcdefghijklmn         abcdefghijklmn&lt;br /&gt;
	&amp;quot;A&amp;quot;: 0b11010100010101, &amp;quot;N&amp;quot;: 0b00110100110100, &amp;quot;0&amp;quot;: 0b01010111010110,&lt;br /&gt;
	&amp;quot;B&amp;quot;: 0b11011101001001, &amp;quot;O&amp;quot;: 0b01010101010100, &amp;quot;1&amp;quot;: 0b00010110000000,&lt;br /&gt;
	&amp;quot;C&amp;quot;: 0b01000001010100, &amp;quot;P&amp;quot;: 0b11010000010101, &amp;quot;2&amp;quot;: 0b11010001010001,&lt;br /&gt;
	&amp;quot;D&amp;quot;: 0b01011101001000, &amp;quot;Q&amp;quot;: 0b01010101110100, &amp;quot;3&amp;quot;: 0b11010101000001,&lt;br /&gt;
	&amp;quot;E&amp;quot;: 0b11000001010101, &amp;quot;R&amp;quot;: 0b11010000110101, &amp;quot;4&amp;quot;: 0b10010100000101,&lt;br /&gt;
	&amp;quot;F&amp;quot;: 0b11000000010101, &amp;quot;S&amp;quot;: 0b11100101000000, &amp;quot;5&amp;quot;: 0b11000101000101,&lt;br /&gt;
	&amp;quot;G&amp;quot;: 0b11000101010100, &amp;quot;T&amp;quot;: 0b01001000001000, &amp;quot;6&amp;quot;: 0b11000101010101,&lt;br /&gt;
	&amp;quot;H&amp;quot;: 0b10010100010101, &amp;quot;U&amp;quot;: 0b00010101010100, &amp;quot;7&amp;quot;: 0b01010100000000,&lt;br /&gt;
	&amp;quot;I&amp;quot;: 0b01001001001000, &amp;quot;V&amp;quot;: 0b00000010010110, &amp;quot;8&amp;quot;: 0b11010101010101,&lt;br /&gt;
	&amp;quot;J&amp;quot;: 0b00010101010000, &amp;quot;W&amp;quot;: 0b00010100110110, &amp;quot;9&amp;quot;: 0b11010100000101,&lt;br /&gt;
	&amp;quot;K&amp;quot;: 0b00000010110101, &amp;quot;X&amp;quot;: 0b00100010100010,&lt;br /&gt;
	&amp;quot;L&amp;quot;: 0b00000001010100, &amp;quot;Y&amp;quot;: 0b00100010001000,&lt;br /&gt;
	&amp;quot;M&amp;quot;: 0b00110110010100, &amp;quot;Z&amp;quot;: 0b01000011000010	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# loadRAM Reads all 13 bytes of of the screen memory into an array of 26 strings (for easier debugging)&lt;br /&gt;
# It should be loaded before overwriting a character, to preserve the other three.&lt;br /&gt;
def loadRAM(phid, addr):&lt;br /&gt;
	for i in range(13):&lt;br /&gt;
		byte = format(phid.i2cSendReceive(addr,[i],1)[0],&#039;08b&#039;)&lt;br /&gt;
		ram[(i*2)] = byte[:4]&lt;br /&gt;
		ram[(i*2)+1] = byte[4:]&lt;br /&gt;
&lt;br /&gt;
# printMessage prints a scrolling marquee messasge &#039;str&#039;&lt;br /&gt;
def printMessage(str, phid, addr):&lt;br /&gt;
	# Add four spaces to ensure the message scrolls off&lt;br /&gt;
	str += &amp;quot;    &amp;quot;&lt;br /&gt;
	a0 = a1 = a2 = a3 = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	for a in str:&lt;br /&gt;
		a0 = a1&lt;br /&gt;
		a1 = a2&lt;br /&gt;
		a2 = a3&lt;br /&gt;
		a3 = a.upper()&lt;br /&gt;
		clearScreen(phid,addr)&lt;br /&gt;
		printLetter(a0, phid, addr, 0)&lt;br /&gt;
		printLetter(a1, phid, addr, 1)&lt;br /&gt;
		printLetter(a2, phid, addr, 2)&lt;br /&gt;
		printLetter(a3, phid, addr, 3)&lt;br /&gt;
		time.sleep(0.08)&lt;br /&gt;
&lt;br /&gt;
# printLetter prints letter &#039;a&#039; to position &#039;pos&#039;&lt;br /&gt;
def printLetter(a, phid, addr,pos):&lt;br /&gt;
&lt;br /&gt;
	# Confirm parameters are valid&lt;br /&gt;
	if a not in letters or (pos &amp;gt; 3) or (pos &amp;lt; 0):&lt;br /&gt;
		return&lt;br /&gt;
	&lt;br /&gt;
	# Get the segments required for the letter&lt;br /&gt;
	bits = [(letters[a] &amp;gt;&amp;gt; bit) &amp;amp; 1 for bit in range(13,-1,-1)]&lt;br /&gt;
&lt;br /&gt;
	# For each segment, AND or OR it to the existing memory to preseve the other three digits&lt;br /&gt;
	# It had to be broken into two in order to skip over other bytes in the memory string.&lt;br /&gt;
	# The memory string is laid out like this: 00ab0:cd0.ef00gh00ij00kl00mn&lt;br /&gt;
	# Where &#039;:&#039; turns on the center colon and &#039;.&#039; turns on the decimal point when 0001 is written there.&lt;br /&gt;
	for i in range(7):&lt;br /&gt;
		if bits[2*i] == 0:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		if bits[(2*i)+1] == 0:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	hex = bytes(&lt;br /&gt;
		(int(ram[i], 2) &amp;lt;&amp;lt; 4) | int(ram[i+1], 2)&lt;br /&gt;
		for i in range(0, 26, 2)&lt;br /&gt;
	)&lt;br /&gt;
	hex = list(hex)&lt;br /&gt;
	hex.insert(0,0x00) # add the leading 0x00 for writing&lt;br /&gt;
	phid.i2cSendReceive(addr, hex, 0)&lt;br /&gt;
&lt;br /&gt;
# clearScreen clears the screen and the ram array&lt;br /&gt;
def clearScreen(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00], 0)&lt;br /&gt;
	loadRAM(phid,addr)&lt;br /&gt;
&lt;br /&gt;
# initialize sets the clock, brightness and blinking so the screen can operate&lt;br /&gt;
def initialize(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	# Declare and open dataAdapter channel&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x70&lt;br /&gt;
&lt;br /&gt;
	# Clear Screen&lt;br /&gt;
	clearScreen(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	# Initialize display&lt;br /&gt;
	initialize(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	print(&amp;quot;Type a message to display, or &#039;exit&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	message = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	while message != &amp;quot;exit&amp;quot;:&lt;br /&gt;
		try:&lt;br /&gt;
			message = input()&lt;br /&gt;
			printMessage(message,adp,addr)&lt;br /&gt;
		except (Exception, KeyboardInterrupt):&lt;br /&gt;
			pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_SPI_Encoder&amp;diff=35617</id>
		<title>Controlling an SPI Encoder</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_SPI_Encoder&amp;diff=35617"/>
		<updated>2026-04-15T15:15:41Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=SPI Adapter}}&lt;br /&gt;
{{#seo:|description=Control an SPI encoder with the SPI Adapter Phidget}}&lt;br /&gt;
&lt;br /&gt;
[[Image:ADP0002_0.jpg|link=|thumb| 400px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1355 SPI Adapter Phidget (ADP0002_0)]]]&lt;br /&gt;
==Introduction==&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1355 SPI Adapter Phidget] allows you to interface with a wide range of SPI-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control an absolute position magnetic encoder. &lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the SPI Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following datasheet will be referenced throughout this project:&lt;br /&gt;
* [https://ams-osram.com/products/boards-kits-accessories/boards/ams-as5048a-ts-evm-ab-evaluation-board Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/f/fd/AS5048A.pdf AS5048A Encoder Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|-TkTykk1Ris|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Additional Information===&lt;br /&gt;
[[Image:Adp0002_magnet.png|link=https://cdn.phidgets.com/docs/images/2/2e/Adp0002_magnet.png|thumb]]&lt;br /&gt;
The encoder is designed to be used with a small magnet, magnetized with the poles on the edges of the cylinder instead of the top and bottom. The magnet can be attached to the exposed rear shaft of a motor, and this sensor can use the position of the magnetic field to determine the absolute position of the shaft.&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Endianness (MSB-first or LSB-first)&lt;br /&gt;
* Chip Select Polarity&lt;br /&gt;
* SPI Wire Mode&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. &lt;br /&gt;
Based on the AS5048A datasheet, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V or 5V (we&#039;ll use 5V)&lt;br /&gt;
* Communication Frequency: The clock period is 100ns minimum (10MHz maximum)&lt;br /&gt;
* Endianness: MSB-first&lt;br /&gt;
* Chip Select: Active Low&lt;br /&gt;
* SPI Wire Mode: Mode = 1&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. Some devices have certain commands that must be sent to configure the device, but this one is ready to provide sensor data as soon as it&#039;s powered up.&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_commandflow.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 11)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This diagram explains that each command we send will have its response delivered during the next transaction. Since our first goal is to get a stream of angle data from the encoder, we can just continuously send the Read Angle command. &lt;br /&gt;
&lt;br /&gt;
===Reading from AS5048A Registers===&lt;br /&gt;
&lt;br /&gt;
Commands sent to the encoder must follow the following format:&lt;br /&gt;
[[Image:SPI_command_package.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 14)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
This table tells us that the 16-bit command package consists of a parity bit, a read/write bit, and then a 14-bit register address. &lt;br /&gt;
&lt;br /&gt;
There are three data readout registers we can access. Here is the definition for the angle register:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_command_angle_readout.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 17)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The register address for the angle data is &#039;&#039;&#039;0x3FFF&#039;&#039;&#039;, but this is not the complete 16-bit value we need to transmit. First, we must add the R/W bit (Read=1) and then calculate the parity bit for even parity.&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_command_parity.png|link=|center|700px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Calculating the parity bit&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This results in &#039;&#039;&#039;0xFFFF&#039;&#039;&#039;, which is the command we need to send with the SPI Phidget.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0002 ==&lt;br /&gt;
&lt;br /&gt;
The wiring for this sensor is very straightforward with the ADP0002:&lt;br /&gt;
[[Image:SPI_encoder_pinout.png|link=|120px|left]]&lt;br /&gt;
* &#039;&#039;&#039;5V&#039;&#039;&#039; - VCC&lt;br /&gt;
* &#039;&#039;&#039;3.3V&#039;&#039;&#039; - Not connected&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Not connected&lt;br /&gt;
* &#039;&#039;&#039;SDA/CSn&#039;&#039;&#039; - CS&lt;br /&gt;
* &#039;&#039;&#039;SCL/SCK&#039;&#039;&#039; - SCLK&lt;br /&gt;
* &#039;&#039;&#039;A1/MOSI&#039;&#039;&#039; - MOSI&lt;br /&gt;
* &#039;&#039;&#039;A2/MISO&#039;&#039;&#039; - MISO&lt;br /&gt;
* &#039;&#039;&#039;GND&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_wiring_diagram.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
== Testing in the Phidget Control Panel ==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
=== Reading the Angle ===&lt;br /&gt;
&lt;br /&gt;
==== Reading the Angle in the Control Panel ====&lt;br /&gt;
Set the voltage to 5V, the chip select to Active Low, the wire mode to Mode_1, and the frequency to any value as they are all within the stated range.&lt;br /&gt;
&lt;br /&gt;
We can try sending our &#039;&#039;&#039;0xFFFF&#039;&#039;&#039; command we calculated in the previous step:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_angle_send.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
The first response is an empty &#039;&#039;&#039;0x0000&#039;&#039;&#039;, because responses are always sent in the next transaction. After that, we start getting data back from the encoder. In order to decode these values, we must go back to the datasheet and pay attention to the read package format.&lt;br /&gt;
&lt;br /&gt;
==== Decoding the Read Data Package ====&lt;br /&gt;
[[Image:SPI_read_package.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 15)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similar to the command package, it&#039;s made up of two control bits and one 14-bit value. The control bits are a parity bit to ensure communication fidelity, and an error flag that activates if there&#039;s a problem with the previous transaction. In this example we&#039;ll ignore these bits, but in an actual deployment you&#039;d want to be checking both of these bits on each transaction.&lt;br /&gt;
&lt;br /&gt;
So to decode the response for our angle command, &#039;&#039;&#039;0x9048&#039;&#039;&#039;, we need to strip the top two bits:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_decode_response.png|link=|center|800px]]&lt;br /&gt;
&lt;br /&gt;
This leaves us with &#039;&#039;&#039;0x1048&#039;&#039;&#039;, or 4168 in decimal. The encoder has 14-bit precision, so the formula is as follows:&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;\text{Angle(°)} = \frac{\text{n}}{2^{14}} \times 360 \!&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &#039;n&#039; is the response in decimal. Using this equation, our angle works out to &#039;&#039;&#039;91.58 degrees&#039;&#039;&#039;. When we eventually write our own program, we&#039;ll handle all of this bit manipulation and unit conversion in code.&lt;br /&gt;
&lt;br /&gt;
=== Zeroing the Encoder ===&lt;br /&gt;
&lt;br /&gt;
The advantage of an absolute encoder is that the actual angle of the shaft will be known as soon as the system is powered, without need for calibration or homing. This also means that the &amp;quot;home position&amp;quot; of our rotary system will be an arbitrary angle. We could zero this by keeping track of the initial angle in our program, but this chip has its own zeroing feature, so let&#039;s take a look.&lt;br /&gt;
&lt;br /&gt;
==== Zeroing Command Registers and Sequence ====&lt;br /&gt;
&lt;br /&gt;
We can find the zeroing process in the datasheet:&lt;br /&gt;
# Clear zero position registers by writing &#039;0&#039; into them&lt;br /&gt;
# Read the current angle&lt;br /&gt;
# Write the angle into the zero position registers&lt;br /&gt;
# (optional) Burn the value into the register so it persists across power cycles&lt;br /&gt;
&lt;br /&gt;
For now we&#039;ll only do the steps 2 and 3, since the zero position registers will already be zero on startup by default since we haven&#039;t burned a value into the register. In our final program we&#039;ll be using the zero as a sort of &#039;tare&#039; function so we will have to do the first step there. Here are the zero register definitions:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_zero_registers.png|link=|center|800px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;AS5048A datasheet (page 17)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as before, we need to add the proper control bits to these address values before we send them.&lt;br /&gt;
* Write to Zero Position Hi: 0x0016 -&amp;gt; &#039;&#039;&#039;0x8016&#039;&#039;&#039;&lt;br /&gt;
* Write to Zero Position Lo: 0x0017 -&amp;gt; &#039;&#039;&#039;0x0017&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For each of these registers, we&#039;ll follow this flow:&lt;br /&gt;
* Write to the zero position command&lt;br /&gt;
* Send the angle data&lt;br /&gt;
* Send a NOP (empty command) to confirm data sent&lt;br /&gt;
&lt;br /&gt;
==== Zeroing in the Control Panel ====&lt;br /&gt;
&lt;br /&gt;
In this example, our received data is &#039;&#039;&#039;0xBB99&#039;&#039;&#039;. Stripping the control bits, we get &#039;&#039;&#039;0x3B99&#039;&#039;&#039; or &#039;&#039;&#039;11 1011 1001 1001&#039;&#039;&#039; in binary. According to the zero register definitions, we need the 6 least significant bits in the low register, and the other 8 in the high register. This gives us:&lt;br /&gt;
&lt;br /&gt;
* LSB: &#039;&#039;&#039;0b011001&#039;&#039;&#039; &#039;&#039;&#039;(0x19)&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;0x8019&#039;&#039;&#039;&lt;br /&gt;
* MSB: &#039;&#039;&#039;0b11101110&#039;&#039;&#039; &#039;&#039;&#039;(0xEE)&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;0x00EE&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Again, since we need to set the write bits and proper parity, we end up with &#039;&#039;&#039;0x8019&#039;&#039;&#039; and &#039;&#039;&#039;0x00EE&#039;&#039;&#039;. Here&#039;s what the zeroing process looks like in the control panel (annotations added for clarity):&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_controlpanel_zero.png|link=|center|850px]]&lt;br /&gt;
&lt;br /&gt;
There are no error bits set in the responses, and each register we set echoed back the correct value when we wrote to it. The angle response we got after zeroing is &#039;&#039;&#039;0xBFF7&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
* Strip control bits -&amp;gt; 0x3FF7&lt;br /&gt;
* Convert to decimal -&amp;gt; 16375&lt;br /&gt;
* Angle formula -&amp;gt; 359.80°&lt;br /&gt;
&lt;br /&gt;
Since our new angle is close to 360° (the same as 0°), it looks like the zeroing process was successful.&lt;br /&gt;
&lt;br /&gt;
== Writing a Custom Python Script ==&lt;br /&gt;
&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the code sample to demonstrate a simple readout of the encoder angle:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def hex2angle(hex):&lt;br /&gt;
	bytes = (hex[0] &amp;lt;&amp;lt; 8) | hex[1]      # Combine MSB and LSB&lt;br /&gt;
	bytes = bytes &amp;amp; 0b0011111111111111  # Discard top two bits (parity and error flag bits)&lt;br /&gt;
	angle = round(bytes / 16348*360,3)  # Divide by 2^14, multiply by 360 to get degrees&lt;br /&gt;
	return angle&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
	# Open ADP0002&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setEndianness(DataAdapterEndianness.ENDIANNESS_MSB_FIRST)&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_1500kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_5_0V)&lt;br /&gt;
	adp.setSPIChipSelect(DataAdapterSPIChipSelect.SPI_CHIP_SELECT_ACTIVE_LOW)&lt;br /&gt;
	adp.setSPIMode(DataAdapterSPIMode.SPI_MODE_1)&lt;br /&gt;
	time.sleep(0.5)&lt;br /&gt;
&lt;br /&gt;
	# Read and print angle until keyboard interrupt&lt;br /&gt;
	print(&amp;quot;Printing encoder data. Press CTRL+C to quit.&amp;quot;)&lt;br /&gt;
	try:&lt;br /&gt;
		while True:&lt;br /&gt;
			recvData = adp.sendPacketWaitResponse([0xFF,0xFF])&lt;br /&gt;
			print(f&amp;quot;\rEncoder Angle: {hex2angle(recvData)}    &amp;quot;,end=&amp;quot;&amp;quot;,flush=True)&lt;br /&gt;
			time.sleep(0.1)&lt;br /&gt;
&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It displays the encoder angle and also provides the option to zero the encoder.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
import threading&lt;br /&gt;
&lt;br /&gt;
# Register definitions from datasheet&lt;br /&gt;
ANGLE = [0x3F,0xFF]&lt;br /&gt;
MAGNITUDE = [0x3F,0xFE]&lt;br /&gt;
DIAGNOSTIC = [0x3F,0xFD]&lt;br /&gt;
CLEAR_ERR = [0x00,0x01]&lt;br /&gt;
NOP = [0x00,0x00]&lt;br /&gt;
ZERO_POS_HI = [0x00,0x16]&lt;br /&gt;
ZERO_POS_LO = [0x00,0x17]&lt;br /&gt;
READ = 1&lt;br /&gt;
WRITE = 0&lt;br /&gt;
&lt;br /&gt;
adp = DataAdapter()&lt;br /&gt;
&lt;br /&gt;
# Listener for keypress during main loop&lt;br /&gt;
running = True&lt;br /&gt;
def keyboard_listener():&lt;br /&gt;
    global running&lt;br /&gt;
    while running:&lt;br /&gt;
        cmd = input().strip().lower()&lt;br /&gt;
        if cmd == &amp;quot;z&amp;quot;:&lt;br /&gt;
            zero()&lt;br /&gt;
        elif cmd == &amp;quot;q&amp;quot;:&lt;br /&gt;
            running = False&lt;br /&gt;
&lt;br /&gt;
# Adds the required RW and parity bits&lt;br /&gt;
def addBits(packet,rw):&lt;br /&gt;
	bits = ((packet[0] &amp;lt;&amp;lt; 8) | packet[1]) &amp;amp; 0x3FFF&lt;br /&gt;
&lt;br /&gt;
	if(rw):&lt;br /&gt;
		bits = bits | 0b0100000000000000&lt;br /&gt;
	else:&lt;br /&gt;
		bits = bits &amp;amp; 0b1011111111111111&lt;br /&gt;
&lt;br /&gt;
	if(bits.bit_count()%2 == 0):&lt;br /&gt;
		bits = bits &amp;amp; 0b0111111111111111&lt;br /&gt;
	else:&lt;br /&gt;
		bits = bits | 0b1000000000000000&lt;br /&gt;
		&lt;br /&gt;
	res = [(bits &amp;gt;&amp;gt; 8)&amp;amp; 0xFF,(bits &amp;amp; 0xFF)]&lt;br /&gt;
	return res&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def zero():&lt;br /&gt;
	# Clear zero registers - this is needed to be able to zero more than once per run&lt;br /&gt;
	adp.sendPacket(addBits(ZERO_POS_HI,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits([0x00,0x00],WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(NOP,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(ZERO_POS_LO,WRITE))&lt;br /&gt;
	adp.sendPacket(addBits([0x00,0x00],WRITE))&lt;br /&gt;
	adp.sendPacket(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
	# Read current angle&lt;br /&gt;
	adp.sendPacket(addBits(ANGLE,READ))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
	# Combine angle bytes and mask out err/parity bits&lt;br /&gt;
	angle = ((resp[0] &amp;lt;&amp;lt; 8) | resp[1]) &amp;amp; 0x3FFF&lt;br /&gt;
&lt;br /&gt;
	# Split out angle for sending to zero registers&lt;br /&gt;
	zposm = (angle &amp;gt;&amp;gt; 6) &amp;amp; 0xFF &lt;br /&gt;
	zposl = angle &amp;amp; 0x3F&lt;br /&gt;
&lt;br /&gt;
	# write ZPOSM (0x0016)&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(ZERO_POS_HI,WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits([0x00,zposm],WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
    # write ZPOSL (0x0017)&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(ZERO_POS_LO,WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits([0x00,zposl],WRITE))&lt;br /&gt;
	resp = adp.sendPacketWaitResponse(addBits(NOP,WRITE))&lt;br /&gt;
&lt;br /&gt;
def hex2angle(hex):&lt;br /&gt;
	bytes = (hex[0] &amp;lt;&amp;lt; 8) | hex[1]      # Combine MSB and LSB&lt;br /&gt;
	bytes = bytes &amp;amp; 0b0011111111111111  # Discard top two bits (parity and error flag bits)&lt;br /&gt;
	angle = round(bytes / 16348*360,3)  # Divide by 2^14, multiply by 360 to get degrees&lt;br /&gt;
	return angle&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
	# Open ADP0002&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setEndianness(DataAdapterEndianness.ENDIANNESS_MSB_FIRST)&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_1500kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_5_0V)&lt;br /&gt;
	adp.setSPIChipSelect(DataAdapterSPIChipSelect.SPI_CHIP_SELECT_ACTIVE_LOW)&lt;br /&gt;
	adp.setSPIMode(DataAdapterSPIMode.SPI_MODE_1)&lt;br /&gt;
	time.sleep(0.5)&lt;br /&gt;
&lt;br /&gt;
	# Start thread for keypress detection during the loop&lt;br /&gt;
	threading.Thread(target=keyboard_listener, daemon=True).start()&lt;br /&gt;
	print(&amp;quot;Printing encoder data. Press &#039;z&#039; to zero and &#039;q&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	# Read and print angle until &#039;q&#039; pressed&lt;br /&gt;
	try:&lt;br /&gt;
		while running:&lt;br /&gt;
			recvData = adp.sendPacketWaitResponse(addBits(ANGLE,READ))&lt;br /&gt;
			print(f&amp;quot;\rEncoder Angle: {hex2angle(recvData)}    &amp;quot;,end=&amp;quot;&amp;quot;,flush=True)&lt;br /&gt;
			time.sleep(0.1)&lt;br /&gt;
&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Reading_an_I2C_Color_Sensor&amp;diff=35616</id>
		<title>Reading an I2C Color Sensor</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Reading_an_I2C_Color_Sensor&amp;diff=35616"/>
		<updated>2026-04-15T15:15:07Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=I2C Adapter}}&lt;br /&gt;
{{#seo:|description=Read an I2C color sensor with the I2C Adapter Phidget}}&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to read data from an RGB Color Sensor.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resource will be referenced throughout this project.&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/1/13/TCS34725.pdf TCS34725 RGB Color Sensor IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|dYREkxXgjEA|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_rgb_specs2.png|link=https://cdn.phidgets.com/docs/images/0/05/Adp0002_rgb_specs2.png|thumb|&amp;lt;center&amp;gt;Excerpts from Datasheet&amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or datasheet. In this case, it was all found on pages 3 to 5 of the datasheet:&lt;br /&gt;
* Supply Voltage: 3.3V&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x29&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The TCS34725 datasheet provides a state diagram that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_states.png|link=https://cdn.phidgets.com/docs/images/0/0e/Adp0002_rgb_states.png|200px|right|thumb|&amp;lt;center&amp;gt;From datasheet (page 7)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the state diagram, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable PON (power on) to go from sleep to idle state&lt;br /&gt;
# Enable AEN (RGB enabled) to go from idle to RGBC state&lt;br /&gt;
&lt;br /&gt;
After these steps, the device should be able to provide data and respond to commands. We&#039;re not using WEN (wait enabled) since we don&#039;t need this power-saving feature at this time.&lt;br /&gt;
&lt;br /&gt;
===Writing to TCS34725 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
This protocol diagram from page 12 of the datasheet confirms that the TCS34725 behaves as expected:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_protocol.png|link=https://cdn.phidgets.com/docs/images/3/38/Adp0002_rgb_protocol.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The Start (S), Stop (P), Acknowledge (A), and W/R (Write/Read) is all handled internally by the I2C Phidget, so we just need to focus on the command code and data. &lt;br /&gt;
&lt;br /&gt;
==== Command Register ====&lt;br /&gt;
&lt;br /&gt;
The command register lets us tell the sensor which register we want to read or write on our next communication. &lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdreg.png|link=https://cdn.phidgets.com/docs/images/0/0d/Adp0002_rgb_cmdreg.png|750px|center]]&lt;br /&gt;
&lt;br /&gt;
* The first bit is always &#039;1&#039;&lt;br /&gt;
* The next two bits control the how the device behaves when requesting multiple bytes&lt;br /&gt;
* The last five bits hold the register address (we can ignore the special functions for this project)&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an abridged list of registers we&#039;ll be using:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_registers.png|link=https://cdn.phidgets.com/docs/images/4/48/Adp0002_rgb_registers.png|600px|center]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the Sensor====&lt;br /&gt;
Enable is managed by register &#039;&#039;&#039;0x00&#039;&#039;&#039;, so our command register will look like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdenable.png|link=https://cdn.phidgets.com/docs/images/0/03/Adp0002_rgb_cmdenable.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
So we&#039;ll send &#039;&#039;&#039;0x80&#039;&#039;&#039; to select the enable register.&lt;br /&gt;
&lt;br /&gt;
The enable register is defined in the datasheet as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_enablereg.png|link=https://cdn.phidgets.com/docs/images/8/89/Adp0002_rgb_enablereg.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
* Bits 5, 6, and 7 are &#039;&#039;&#039;000&#039;&#039;&#039;, as they&#039;re reserved&lt;br /&gt;
* Bit 4 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not using interrupts&lt;br /&gt;
* Bit 3 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not using the wait feature&lt;br /&gt;
* Bit 2 is &#039;&#039;&#039;0&#039;&#039;&#039;, as it&#039;s reserved&lt;br /&gt;
* Bit 1 will be &#039;&#039;&#039;0&#039;&#039;&#039;, since we&#039;re not enabling RGBC yet&lt;br /&gt;
* Bit 0 will be &#039;&#039;&#039;1&#039;&#039;&#039;, to enable power&lt;br /&gt;
&lt;br /&gt;
That gives us &#039;&#039;&#039;0x01&#039;&#039;&#039;. Together with our command register, our first communication will be &#039;&#039;&#039;0x8001&#039;&#039;&#039;.&lt;br /&gt;
The reason we don&#039;t enable RGBC yet is because the device requires a 2.4ms delay between PON and RGBC for reliable startup.&lt;br /&gt;
&lt;br /&gt;
====Enable RGBC====&lt;br /&gt;
&lt;br /&gt;
To enable RGBC we will use the same command we used for power on, but both the AEN bit and the PON bit will be 1. This gives us &#039;&#039;&#039;0x8003&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Reading Data ===&lt;br /&gt;
&lt;br /&gt;
Now that the sensor is initialized, we can start getting data from it. We want to read all eight color registers, so we need to set auto-increment in the command register and point it to the first color register which is at 0x14:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_rgb_cmdreadauto.png|link=https://cdn.phidgets.com/docs/images/8/87/Adp0002_rgb_cmdreadauto.png|center|850px]]&lt;br /&gt;
&lt;br /&gt;
This means we need to send &#039;&#039;&#039;B4&#039;&#039;&#039;. After that, we can listen for 8 bytes at a time to get all of our color data.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
The pinout for this sensor is printed on the PCB:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_rgb_pinout2.png|link=|130px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;VIN&#039;&#039;&#039; - Power&lt;br /&gt;
*&#039;&#039;&#039;GND&#039;&#039;&#039; - Ground&lt;br /&gt;
*&#039;&#039;&#039;3V3&#039;&#039;&#039; - 3.3V Output &lt;br /&gt;
*&#039;&#039;&#039;SCL&#039;&#039;&#039; - Serial Clock&lt;br /&gt;
*&#039;&#039;&#039;SDA&#039;&#039;&#039; - Serial Data&lt;br /&gt;
*&#039;&#039;&#039;INT&#039;&#039;&#039; - Interrupt&lt;br /&gt;
*&#039;&#039;&#039;LED&#039;&#039;&#039; - LED toggle&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need the 3.3V output or the interrupt pin for this project. The other pins can be connected to the ADP0001 as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_rgb_connection.png|800px|link=https://cdn.phidgets.com/docs/images/d/d9/I2C_rgb_connection.png]]&lt;br /&gt;
&lt;br /&gt;
The LED toggle pin is connected to one of the ADP0001&#039;s GPIO pins so we can use it to turn off the LED when not in use.&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the command sequence and our sensor connected, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x29.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel.png|link=https://cdn.phidgets.com/docs/images/2/20/I2C_RGB_ControlPanel.png|center]]&lt;br /&gt;
&lt;br /&gt;
Now we can enable the sensor with our command sequence:&lt;br /&gt;
* 0x8001 (Power on)&lt;br /&gt;
* 0x8003 (RGBC on)&lt;br /&gt;
* 0xB4 (auto increment and start from register 0x14)&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/4/4f/I2C_RGB_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Reading Data===&lt;br /&gt;
After sending the command register B4, we can read all color registers by reading 8 bytes at a time.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_RGB_ControlPanel3.png|link=https://cdn.phidgets.com/docs/images/0/0a/I2C_RGB_ControlPanel3.png|center]]&lt;br /&gt;
[[Image:I2C_RGB_responsegraph.png|link=https://wwwdev.int.phidgets.com/docs/images/9/97/I2C_RGB_responsegraph.png|thumb|&amp;lt;center&amp;gt;Sensor response characteristic (pg.6)&amp;lt;center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This sensor ultimately provides us with four 16-bit values: Clear, Red, Green, and Blue. The clear light value is important for providing brightness calibration. Since the responses of the red, green and blue sensors are normalized to match the response of the clear sensor, we can use it as a baseline to determine color in both bright and dim environments. &lt;br /&gt;
&lt;br /&gt;
In the above image, we get roughly the same value when polling the sensor three times, so the value seems stable. We&#039;ll use the bottom row to see if the color makes sense. The data bytes received are sent in register order, so our values are:&lt;br /&gt;
&lt;br /&gt;
* Clear: 0x0FFD&lt;br /&gt;
* Red: 0x0A96&lt;br /&gt;
* Green: 0x0331&lt;br /&gt;
* Blue: 0x0271&lt;br /&gt;
&lt;br /&gt;
Converting to decimal, that&#039;s 4093, 2710, 817, 625. We can normalize the last three values using the clear value, and then multiply by 255 and round to get a standard RGB value:&lt;br /&gt;
&lt;br /&gt;
* Red:   (2710/4093)*255 = 169&lt;br /&gt;
* Green: (817/4093)*255  = 51&lt;br /&gt;
* Blue:  (625/4093)*255  = 39&lt;br /&gt;
&lt;br /&gt;
This RGB value &#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:#A93327&amp;quot;&amp;gt;(#A93327)&amp;lt;/span&amp;gt;&#039;&#039;&#039; looks to be correct, as the sensor was pointed at a roll of red electrical tape. &lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the Python code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def convert_rgbc(data):&lt;br /&gt;
&lt;br /&gt;
	c = data[1] &amp;lt;&amp;lt; 8 | data[0]&lt;br /&gt;
&lt;br /&gt;
	if(c &amp;lt;= 0):&lt;br /&gt;
		return [0,0,0]&lt;br /&gt;
&lt;br /&gt;
	# Combine high and low bytes for each color,&lt;br /&gt;
	# Then normalize and cap at 255&lt;br /&gt;
	r = min(255,round((data[3] &amp;lt;&amp;lt; 8 | data[2]) / c * 255))&lt;br /&gt;
	g = min(255,round((data[5] &amp;lt;&amp;lt; 8 | data[4]) / c * 255))&lt;br /&gt;
	b = min(255,round((data[7] &amp;lt;&amp;lt; 8 | data[6]) / c * 255))&lt;br /&gt;
	return [r,g,b]&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x29&lt;br /&gt;
&lt;br /&gt;
	# Power On&lt;br /&gt;
	adp.i2cSendReceive(addr, [0x8001], 0)&lt;br /&gt;
	time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
	# RGBC On&lt;br /&gt;
	adp.i2cSendReceive(addr, [0x8003], 0)&lt;br /&gt;
&lt;br /&gt;
	# Auto-increment starting with CDATAL&lt;br /&gt;
	adp.i2cSendReceive(addr, [0xB4], 0)&lt;br /&gt;
&lt;br /&gt;
	try:&lt;br /&gt;
		while True:&lt;br /&gt;
			rgb = convert_rgbc(adp.i2cSendReceive(addr, [], 8))&lt;br /&gt;
			print(&amp;quot;R: &amp;quot; + str(rgb[0]) + &amp;quot;   G: &amp;quot; + str(rgb[1]) + &amp;quot;   B: &amp;quot; + str(rgb[2]))&lt;br /&gt;
			time.sleep(0.5)&lt;br /&gt;
			pass&lt;br /&gt;
	except KeyboardInterrupt:&lt;br /&gt;
		print(&amp;quot;Closing...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Python Graphical Example===&lt;br /&gt;
Here is a more in-depth script that displays a graph of the raw values and shows the calculated color after gamma and saturation adjustment. &lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
import tkinter as tk&lt;br /&gt;
import math&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
class MultiLineGraph(tk.Canvas):&lt;br /&gt;
    def __init__(self, parent, lines=4, max_points=100, **kwargs):&lt;br /&gt;
        super().__init__(parent, bg=&amp;quot;black&amp;quot;, **kwargs)&lt;br /&gt;
        self.lines = lines&lt;br /&gt;
        self.max_points = max_points&lt;br /&gt;
        self.data = [[] for _ in range(lines)]&lt;br /&gt;
        self.colors = [&amp;quot;white&amp;quot;, &amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;, &amp;quot;blue&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
    def add_points(self, *values):&lt;br /&gt;
        for i, v in enumerate(values):&lt;br /&gt;
            self.data[i].append(v)&lt;br /&gt;
            if len(self.data[i]) &amp;gt; self.max_points:&lt;br /&gt;
                self.data[i].pop(0)&lt;br /&gt;
        self.draw()&lt;br /&gt;
&lt;br /&gt;
    def draw(self):&lt;br /&gt;
        self.delete(&amp;quot;all&amp;quot;)&lt;br /&gt;
        w = self.winfo_width()&lt;br /&gt;
        h = self.winfo_height()&lt;br /&gt;
&lt;br /&gt;
        if w &amp;lt; 10 or h &amp;lt; 10:&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        # Flatten all visible data&lt;br /&gt;
        all_values = [v for line in self.data for v in line]&lt;br /&gt;
&lt;br /&gt;
        if not all_values:&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        min_val = min(all_values)&lt;br /&gt;
        max_val = max(all_values)&lt;br /&gt;
&lt;br /&gt;
        # Prevent divide-by-zero&lt;br /&gt;
        if max_val == min_val:&lt;br /&gt;
            max_val += 1&lt;br /&gt;
&lt;br /&gt;
        padding = (max_val - min_val) * 0.1  # 10% padding&lt;br /&gt;
        min_val -= padding&lt;br /&gt;
        max_val += padding&lt;br /&gt;
&lt;br /&gt;
        for i, line in enumerate(self.data):&lt;br /&gt;
            if len(line) &amp;lt; 2:&lt;br /&gt;
                continue&lt;br /&gt;
&lt;br /&gt;
            points = []&lt;br /&gt;
            for j, val in enumerate(line):&lt;br /&gt;
                x = j / (self.max_points - 1) * w&lt;br /&gt;
&lt;br /&gt;
                # Normalize to 0–1&lt;br /&gt;
                norm = (val - min_val) / (max_val - min_val)&lt;br /&gt;
&lt;br /&gt;
                # Flip Y (Tkinter origin is top-left)&lt;br /&gt;
                y = h - (norm * h)&lt;br /&gt;
&lt;br /&gt;
                points.extend([x, y])&lt;br /&gt;
&lt;br /&gt;
            self.create_line(points, fill=self.colors[i], width=2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class App:&lt;br /&gt;
    def __init__(self, root):&lt;br /&gt;
        self.root = root&lt;br /&gt;
        self.root.title(&amp;quot;I2C RGB Viewer&amp;quot;)&lt;br /&gt;
        self.adp = DataAdapter()&lt;br /&gt;
        self.addr = 0x29&lt;br /&gt;
        self.sat = 1.8&lt;br /&gt;
        self.gamma = 1.3&lt;br /&gt;
&lt;br /&gt;
        # --- Define Gamma Table ---&lt;br /&gt;
        self.gamma_table = [0] * 256&lt;br /&gt;
        for i in range(256):&lt;br /&gt;
            self.gamma_table[i] = int(math.pow(i/255.0,self.gamma)*255)&lt;br /&gt;
&lt;br /&gt;
        # --- UI ---&lt;br /&gt;
        self.graph = MultiLineGraph(root, height=300)&lt;br /&gt;
        self.graph.pack(fill=&amp;quot;both&amp;quot;, expand=True)&lt;br /&gt;
&lt;br /&gt;
        self.rgb_entry = tk.Entry(root, font=(&amp;quot;Consolas&amp;quot;, 14))&lt;br /&gt;
        self.rgb_entry.pack(fill=&amp;quot;x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        self.color_panel = tk.Frame(root, height=50, bg=&amp;quot;black&amp;quot;)&lt;br /&gt;
        self.color_panel.pack(fill=&amp;quot;x&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
        self.adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
        # Set properties&lt;br /&gt;
        self.adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
        self.adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
&lt;br /&gt;
        # Power On&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0x8001], 0)&lt;br /&gt;
        time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
        # RGBC On&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0x8003], 0)&lt;br /&gt;
&lt;br /&gt;
        # Auto-increment starting with CDATAL&lt;br /&gt;
        self.adp.i2cSendReceive(self.addr, [0xB4], 0)&lt;br /&gt;
&lt;br /&gt;
        # --- Timer ---&lt;br /&gt;
        self.update_loop()&lt;br /&gt;
&lt;br /&gt;
    def read_sensor(self):&lt;br /&gt;
        &lt;br /&gt;
        data = self.adp.i2cSendReceive(self.addr, [], 8)&lt;br /&gt;
&lt;br /&gt;
        # Combine high and low bytes for clear register&lt;br /&gt;
        raw_c = data[1] &amp;lt;&amp;lt; 8 | data[0]&lt;br /&gt;
&lt;br /&gt;
        if(raw_c &amp;lt;= 0):&lt;br /&gt;
            return [0,0,0,0]&lt;br /&gt;
&lt;br /&gt;
        # Combine high and low bytes for each colour&lt;br /&gt;
        raw_r = data[3] &amp;lt;&amp;lt; 8 | data[2]&lt;br /&gt;
        raw_g = data[5] &amp;lt;&amp;lt; 8 | data[4]&lt;br /&gt;
        raw_b = data[7] &amp;lt;&amp;lt; 8 | data[6]&lt;br /&gt;
&lt;br /&gt;
        return raw_c, raw_r, raw_g, raw_b&lt;br /&gt;
&lt;br /&gt;
    def update_loop(self):&lt;br /&gt;
        raw_c, raw_r, raw_g, raw_b = self.read_sensor()&lt;br /&gt;
&lt;br /&gt;
        if raw_c &amp;gt; 0:&lt;br /&gt;
            # Normalize + gamma&lt;br /&gt;
            norm_r = self.gamma_table[int(raw_r / raw_c * 255)]&lt;br /&gt;
            norm_g = self.gamma_table[int(raw_g / raw_c * 255)]&lt;br /&gt;
            norm_b = self.gamma_table[int(raw_b / raw_c * 255)]&lt;br /&gt;
&lt;br /&gt;
            avg = (norm_r + norm_g + norm_b) / 3&lt;br /&gt;
&lt;br /&gt;
            # Saturation adjust&lt;br /&gt;
            norm_r = max(0, min(255, avg + (norm_r - avg) * self.sat))&lt;br /&gt;
            norm_g = max(0, min(255, avg + (norm_g - avg) * self.sat))&lt;br /&gt;
            norm_b = max(0, min(255, avg + (norm_b - avg) * self.sat))&lt;br /&gt;
&lt;br /&gt;
            hex_color = &amp;quot;#{:02X}{:02X}{:02X}&amp;quot;.format(&lt;br /&gt;
                int(norm_r), int(norm_g), int(norm_b)&lt;br /&gt;
            )&lt;br /&gt;
&lt;br /&gt;
            self.rgb_entry.delete(0, tk.END)&lt;br /&gt;
            self.rgb_entry.insert(0, hex_color)&lt;br /&gt;
&lt;br /&gt;
            self.color_panel.config(bg=hex_color)&lt;br /&gt;
&lt;br /&gt;
        # Update graph&lt;br /&gt;
        self.graph.add_points(raw_c, raw_r, raw_g, raw_b)&lt;br /&gt;
&lt;br /&gt;
        # Repeat every 50 ms&lt;br /&gt;
        self.root.after(50, self.update_loop)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
    root = tk.Tk()&lt;br /&gt;
    app = App(root)&lt;br /&gt;
    root.geometry(&amp;quot;600x400&amp;quot;)&lt;br /&gt;
    root.mainloop()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35615</id>
		<title>Controlling an I2C Display</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35615"/>
		<updated>2026-04-15T15:14:17Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: Project]]&lt;br /&gt;
{{#seo:|keywords=I2C Adapter}}&lt;br /&gt;
{{#seo:|description=Control an 14-segment LCD display with the I2C Adapter Phidget}}&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control a 14-segment alphanumeric display.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resources will be referenced throughout this project.&lt;br /&gt;
* [https://www.sparkfun.com/sparkfun-qwiic-alphanumeric-display-red.html Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/7/7b/VK16K33.pdf VK16K33 LED Driver IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|x2YtRTRMybw|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_an_productpage2.png|link=https://cdn.phidgets.com/docs/images/2/26/Adp0002_an_productpage2.png|thumb|&amp;lt;center&amp;gt;Product page features&amp;lt;/center&amp;gt;]]&lt;br /&gt;
[[Image:I2C_Sensor_Freq.png|thumb|link=https://cdn.phidgets.com/docs/images/5/59/I2C_Sensor_Freq.png|&amp;lt;center&amp;gt;VK16K33 datasheet (Page 29)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. Based on these resources, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V*&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&#039;&#039;The datasheet specifies an operating voltage of 4.5-5V, however, this applies only when the chip is powered directly. The breakout board includes an onboard 3.3V to 5V boost circuit, which provides the required operating voltage for the chip.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The VK16K33 datasheet provides flowcharts that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_flow.png|link=https://cdn.phidgets.com/docs/images/a/a8/Adp0002_an_flow.png|750px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Adapted from datasheet (page 26)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the flowcharts, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable the internal system clock&lt;br /&gt;
# Set the dimming register&lt;br /&gt;
# Set the blinking register&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &#039;&#039;The ROW/INT step is ignored because the feature is not being used.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Display Steps&#039;&#039;&#039;&lt;br /&gt;
# Set the write address&lt;br /&gt;
# Send the data to display&lt;br /&gt;
# Turn on the display&lt;br /&gt;
&lt;br /&gt;
===Writing to VK16K33 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The VK16K33 instead expects the following format, where the register address and data is combined into a single byte:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_VK16K33comms4.png|link=https://cdn.phidgets.com/docs/images/c/c5/Adp0002_an_VK16K33comms4.png|400px]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the System Clock====&lt;br /&gt;
The system clock (oscillator) is managed by register &#039;&#039;&#039;0x20&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_SysClock.png|link=https://cdn.phidgets.com/docs/images/d/d7/I2C_Sensor_SysClock.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 7)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This register only has one relevant bit, the &#039;&#039;&#039;S&#039;&#039;&#039; bit in position &#039;&#039;&#039;D8&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;0010 0001&#039;&#039;&#039; (0x21 in hexadecimal), the system clock will be enabled. Bits marked with an &#039;&#039;&#039;X&#039;&#039;&#039; are irrelevant and can be set to either 0 or 1 with no impact.&lt;br /&gt;
&lt;br /&gt;
====Set Dimming Register====&lt;br /&gt;
Dimming is managed by register &#039;&#039;&#039;0xEF&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_dimmingreg.png|link=https://cdn.phidgets.com/docs/images/3/30/Adp0002_an_dimmingreg.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 25)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The register has four relevant bits, &#039;&#039;&#039;P0 through P3&#039;&#039;&#039;, in positions &#039;&#039;&#039;D8 through D11&#039;&#039;&#039;. These bits are used to set the duty cycle of the display, which allows for fine control of brightness. By sending the command &#039;&#039;&#039;1110 1111&#039;&#039;&#039; (0xEF in hexadecimal), maximum brightness is selected.&lt;br /&gt;
&lt;br /&gt;
====Set Blinking Register====&lt;br /&gt;
The blinking frequency and display state is managed by register &#039;&#039;&#039;0x80&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Blink.png|link=|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 9&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three relevant bits in this register: &#039;&#039;&#039;D&#039;&#039;&#039;, &#039;&#039;&#039;B0&#039;&#039;&#039;, and &#039;&#039;&#039;B1&#039;&#039;&#039; in positions &#039;&#039;&#039;D8 through D10&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;1000 0001&#039;&#039;&#039; (0x81 in hexadecimal), the display will be turned on, and blinking will be set to off.&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
====Set the Write Address====&lt;br /&gt;
The display RAM is 16 bytes and begins at address &#039;&#039;&#039;0x00&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_ram.png|link=https://cdn.phidgets.com/docs/images/b/bd/Adp0002_an_ram.png|center|750px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 10&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Send Data to Display====&lt;br /&gt;
The VK16K33 datasheet explains how the sent data translates into certain segments being activated. This is outside the scope of this project, so for the sake of simplicity, we will skip the conversion. A full code sample is provided later in this project and can be reviewed for more information.&lt;br /&gt;
&lt;br /&gt;
====Turn On Display====&lt;br /&gt;
The display was previously turned on during the Power On Steps, so this step can be ignored.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
We don&#039;t have a cable handy for the connectors on this display, so we soldered wires directly to the exposed I2C pads. The product page for the display board provides the following pinout:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pads2.png|link=|75px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;C&#039;&#039;&#039; - SCL&lt;br /&gt;
*&#039;&#039;&#039;D&#039;&#039;&#039; - SDA&lt;br /&gt;
*&#039;&#039;&#039;3&#039;&#039;&#039; - 3.3V&lt;br /&gt;
*&#039;&#039;&#039;G&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can simply wire each of these to their corresponding terminal on the I2C Adapter Phidget. Note that your device&#039;s SCL may be labeled &amp;quot;SCK&amp;quot;, and the SDA pin may be &amp;quot;DIN&amp;quot; depending on which naming convention is used.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pinout.png|800px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x70. We can then queue up the commands we determined in the previous step.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/c/c9/I2C_Sensor_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
Since we have not sent any data to the RAM yet, the segments are uninitialized, with some on and some off:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_UnInit.png|800px|link=https://cdn.phidgets.com/docs/images/8/8c/I2C_Sensor_UnInit.png]]&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
To make the screen display &#039;&#039;&#039;PHID&#039;&#039;&#039;, we will first clear the screen with the following command:&lt;br /&gt;
*&#039;&#039;&#039;0x0000000000000000000000000000&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
We can then send the following data: &lt;br /&gt;
*&#039;&#039;&#039;0x003D000B00CA000C000300C30003&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Multisend.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now see the expected result:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Phid.png|800px|link=https://cdn.phidgets.com/docs/images/c/cd/I2C_Sensor_Phid.png]]&lt;br /&gt;
&lt;br /&gt;
===Reading Display RAM===&lt;br /&gt;
This display also supports reading the RAM, so you can programmatically know what&#039;s currently showing on the display. For most devices, this is as simple as providing the proper command and specifying a number of expected reply bytes. In this case, the device is expecting a stop condition in between the command and the data, as shown by the &#039;P&#039; in the third block in this diagram:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Read.png|850px|link=https://cdn.phidgets.com/docs/images/b/b4/I2C_Sensor_Read.png|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;From page 23 of the datasheet&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to replicate this in the control panel, we must send &#039;&#039;&#039;0x00&#039;&#039;&#039; first, and then send again with no data to listen for our reply bytes. &lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Panel_Read.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the Python code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    clear = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]&lt;br /&gt;
    phid = [0x00,0x3D,0x00,0x0B,0x00,0xCA,0x00,0x0C,0x00,0x03,0x00,0xC3,0x00,0x03]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp = DataAdapter()&lt;br /&gt;
    adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Set properties&lt;br /&gt;
    adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
    adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
    addr = 0x70&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Clear Screen&lt;br /&gt;
    adp.i2cSendReceive(addr, clear, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Initialize display&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Print PHID&lt;br /&gt;
    adp.i2cSendReceive(addr, phid, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        input(&amp;quot;Press Enter to Stop\n&amp;quot;)&lt;br /&gt;
    except (Exception, KeyboardInterrupt):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It will take input from the console and print scrolling messages on the display.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
ram = [&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
#   _ _ _ b _ _ _ &lt;br /&gt;
# | \     |     / |&lt;br /&gt;
# |  c    e    g  |&lt;br /&gt;
# l   \   |   /   d&lt;br /&gt;
# |    \  |  /    |&lt;br /&gt;
# | _ n _ _ _ a _ |&lt;br /&gt;
# |    /  |  \    |&lt;br /&gt;
# j   /   |   \   f&lt;br /&gt;
# |  m    k    i  |&lt;br /&gt;
# | /     |     \ |&lt;br /&gt;
# | _ _ _ h _ _ _ |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
letters = {&lt;br /&gt;
	#      abcdefghijklmn         abcdefghijklmn         abcdefghijklmn&lt;br /&gt;
	&amp;quot;A&amp;quot;: 0b11010100010101, &amp;quot;N&amp;quot;: 0b00110100110100, &amp;quot;0&amp;quot;: 0b01010111010110,&lt;br /&gt;
	&amp;quot;B&amp;quot;: 0b11011101001001, &amp;quot;O&amp;quot;: 0b01010101010100, &amp;quot;1&amp;quot;: 0b00010110000000,&lt;br /&gt;
	&amp;quot;C&amp;quot;: 0b01000001010100, &amp;quot;P&amp;quot;: 0b11010000010101, &amp;quot;2&amp;quot;: 0b11010001010001,&lt;br /&gt;
	&amp;quot;D&amp;quot;: 0b01011101001000, &amp;quot;Q&amp;quot;: 0b01010101110100, &amp;quot;3&amp;quot;: 0b11010101000001,&lt;br /&gt;
	&amp;quot;E&amp;quot;: 0b11000001010101, &amp;quot;R&amp;quot;: 0b11010000110101, &amp;quot;4&amp;quot;: 0b10010100000101,&lt;br /&gt;
	&amp;quot;F&amp;quot;: 0b11000000010101, &amp;quot;S&amp;quot;: 0b11100101000000, &amp;quot;5&amp;quot;: 0b11000101000101,&lt;br /&gt;
	&amp;quot;G&amp;quot;: 0b11000101010100, &amp;quot;T&amp;quot;: 0b01001000001000, &amp;quot;6&amp;quot;: 0b11000101010101,&lt;br /&gt;
	&amp;quot;H&amp;quot;: 0b10010100010101, &amp;quot;U&amp;quot;: 0b00010101010100, &amp;quot;7&amp;quot;: 0b01010100000000,&lt;br /&gt;
	&amp;quot;I&amp;quot;: 0b01001001001000, &amp;quot;V&amp;quot;: 0b00000010010110, &amp;quot;8&amp;quot;: 0b11010101010101,&lt;br /&gt;
	&amp;quot;J&amp;quot;: 0b00010101010000, &amp;quot;W&amp;quot;: 0b00010100110110, &amp;quot;9&amp;quot;: 0b11010100000101,&lt;br /&gt;
	&amp;quot;K&amp;quot;: 0b00000010110101, &amp;quot;X&amp;quot;: 0b00100010100010,&lt;br /&gt;
	&amp;quot;L&amp;quot;: 0b00000001010100, &amp;quot;Y&amp;quot;: 0b00100010001000,&lt;br /&gt;
	&amp;quot;M&amp;quot;: 0b00110110010100, &amp;quot;Z&amp;quot;: 0b01000011000010	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# loadRAM Reads all 13 bytes of of the screen memory into an array of 26 strings (for easier debugging)&lt;br /&gt;
# It should be loaded before overwriting a character, to preserve the other three.&lt;br /&gt;
def loadRAM(phid, addr):&lt;br /&gt;
	for i in range(13):&lt;br /&gt;
		byte = format(phid.i2cSendReceive(addr,[i],1)[0],&#039;08b&#039;)&lt;br /&gt;
		ram[(i*2)] = byte[:4]&lt;br /&gt;
		ram[(i*2)+1] = byte[4:]&lt;br /&gt;
&lt;br /&gt;
# printMessage prints a scrolling marquee messasge &#039;str&#039;&lt;br /&gt;
def printMessage(str, phid, addr):&lt;br /&gt;
	# Add four spaces to ensure the message scrolls off&lt;br /&gt;
	str += &amp;quot;    &amp;quot;&lt;br /&gt;
	a0 = a1 = a2 = a3 = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	for a in str:&lt;br /&gt;
		a0 = a1&lt;br /&gt;
		a1 = a2&lt;br /&gt;
		a2 = a3&lt;br /&gt;
		a3 = a.upper()&lt;br /&gt;
		clearScreen(phid,addr)&lt;br /&gt;
		printLetter(a0, phid, addr, 0)&lt;br /&gt;
		printLetter(a1, phid, addr, 1)&lt;br /&gt;
		printLetter(a2, phid, addr, 2)&lt;br /&gt;
		printLetter(a3, phid, addr, 3)&lt;br /&gt;
		time.sleep(0.08)&lt;br /&gt;
&lt;br /&gt;
# printLetter prints letter &#039;a&#039; to position &#039;pos&#039;&lt;br /&gt;
def printLetter(a, phid, addr,pos):&lt;br /&gt;
&lt;br /&gt;
	# Confirm parameters are valid&lt;br /&gt;
	if a not in letters or (pos &amp;gt; 3) or (pos &amp;lt; 0):&lt;br /&gt;
		return&lt;br /&gt;
	&lt;br /&gt;
	# Get the segments required for the letter&lt;br /&gt;
	bits = [(letters[a] &amp;gt;&amp;gt; bit) &amp;amp; 1 for bit in range(13,-1,-1)]&lt;br /&gt;
&lt;br /&gt;
	# For each segment, AND or OR it to the existing memory to preseve the other three digits&lt;br /&gt;
	# It had to be broken into two in order to skip over other bytes in the memory string.&lt;br /&gt;
	# The memory string is laid out like this: 00ab0:cd0.ef00gh00ij00kl00mn&lt;br /&gt;
	# Where &#039;:&#039; turns on the center colon and &#039;.&#039; turns on the decimal point when 0001 is written there.&lt;br /&gt;
	for i in range(7):&lt;br /&gt;
		if bits[2*i] == 0:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		if bits[(2*i)+1] == 0:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	hex = bytes(&lt;br /&gt;
		(int(ram[i], 2) &amp;lt;&amp;lt; 4) | int(ram[i+1], 2)&lt;br /&gt;
		for i in range(0, 26, 2)&lt;br /&gt;
	)&lt;br /&gt;
	hex = list(hex)&lt;br /&gt;
	hex.insert(0,0x00) # add the leading 0x00 for writing&lt;br /&gt;
	phid.i2cSendReceive(addr, hex, 0)&lt;br /&gt;
&lt;br /&gt;
# clearScreen clears the screen and the ram array&lt;br /&gt;
def clearScreen(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00], 0)&lt;br /&gt;
	loadRAM(phid,addr)&lt;br /&gt;
&lt;br /&gt;
# initialize sets the clock, brightness and blinking so the screen can operate&lt;br /&gt;
def initialize(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	# Declare and open dataAdapter channel&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x70&lt;br /&gt;
&lt;br /&gt;
	# Clear Screen&lt;br /&gt;
	clearScreen(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	# Initialize display&lt;br /&gt;
	initialize(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	print(&amp;quot;Type a message to display, or &#039;exit&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	message = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	while message != &amp;quot;exit&amp;quot;:&lt;br /&gt;
		try:&lt;br /&gt;
			message = input()&lt;br /&gt;
			printMessage(message,adp,addr)&lt;br /&gt;
		except (Exception, KeyboardInterrupt):&lt;br /&gt;
			pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35598</id>
		<title>Controlling an I2C Display</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35598"/>
		<updated>2026-04-13T15:11:42Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Writing a Custom Program */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;A step-by-step example writing code to interface a sensor with the ADP0001.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control a 14-segment alphanumeric display.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resources will be referenced throughout this project.&lt;br /&gt;
* [https://www.sparkfun.com/sparkfun-qwiic-alphanumeric-display-red.html Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/7/7b/VK16K33.pdf VK16K33 LED Driver IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|x2YtRTRMybw|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_an_productpage2.png|link=https://cdn.phidgets.com/docs/images/2/26/Adp0002_an_productpage2.png|thumb|&amp;lt;center&amp;gt;Product page features&amp;lt;/center&amp;gt;]]&lt;br /&gt;
[[Image:I2C_Sensor_Freq.png|thumb|link=https://cdn.phidgets.com/docs/images/5/59/I2C_Sensor_Freq.png|&amp;lt;center&amp;gt;VK16K33 datasheet (Page 29)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. Based on these resources, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V*&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&#039;&#039;The datasheet specifies an operating voltage of 4.5-5V, however, this applies only when the chip is powered directly. The breakout board includes an onboard 3.3V to 5V boost circuit, which provides the required operating voltage for the chip.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The VK16K33 datasheet provides flowcharts that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_flow.png|link=https://cdn.phidgets.com/docs/images/a/a8/Adp0002_an_flow.png|750px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Adapted from datasheet (page 26)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the flowcharts, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable the internal system clock&lt;br /&gt;
# Set the dimming register&lt;br /&gt;
# Set the blinking register&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &#039;&#039;The ROW/INT step is ignored because the feature is not being used.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Display Steps&#039;&#039;&#039;&lt;br /&gt;
# Set the write address&lt;br /&gt;
# Send the data to display&lt;br /&gt;
# Turn on the display&lt;br /&gt;
&lt;br /&gt;
===Writing to VK16K33 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The VK16K33 instead expects the following format, where the register address and data is combined into a single byte:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_VK16K33comms4.png|link=https://cdn.phidgets.com/docs/images/c/c5/Adp0002_an_VK16K33comms4.png|400px]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the System Clock====&lt;br /&gt;
The system clock (oscillator) is managed by register &#039;&#039;&#039;0x20&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_SysClock.png|link=https://cdn.phidgets.com/docs/images/d/d7/I2C_Sensor_SysClock.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 7)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This register only has one relevant bit, the &#039;&#039;&#039;S&#039;&#039;&#039; bit in position &#039;&#039;&#039;D8&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;0010 0001&#039;&#039;&#039; (0x21 in hexadecimal), the system clock will be enabled. Bits marked with an &#039;&#039;&#039;X&#039;&#039;&#039; are irrelevant and can be set to either 0 or 1 with no impact.&lt;br /&gt;
&lt;br /&gt;
====Set Dimming Register====&lt;br /&gt;
Dimming is managed by register &#039;&#039;&#039;0xEF&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_dimmingreg.png|link=https://cdn.phidgets.com/docs/images/3/30/Adp0002_an_dimmingreg.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 25)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The register has four relevant bits, &#039;&#039;&#039;P0 through P3&#039;&#039;&#039;, in positions &#039;&#039;&#039;D8 through D11&#039;&#039;&#039;. These bits are used to set the duty cycle of the display, which allows for fine control of brightness. By sending the command &#039;&#039;&#039;1110 1111&#039;&#039;&#039; (0xEF in hexadecimal), maximum brightness is selected.&lt;br /&gt;
&lt;br /&gt;
====Set Blinking Register====&lt;br /&gt;
The blinking frequency and display state is managed by register &#039;&#039;&#039;0x80&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Blink.png|link=|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 9&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three relevant bits in this register: &#039;&#039;&#039;D&#039;&#039;&#039;, &#039;&#039;&#039;B0&#039;&#039;&#039;, and &#039;&#039;&#039;B1&#039;&#039;&#039; in positions &#039;&#039;&#039;D8 through D10&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;1000 0001&#039;&#039;&#039; (0x81 in hexadecimal), the display will be turned on, and blinking will be set to off.&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
====Set the Write Address====&lt;br /&gt;
The display RAM is 16 bytes and begins at address &#039;&#039;&#039;0x00&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_ram.png|link=https://cdn.phidgets.com/docs/images/b/bd/Adp0002_an_ram.png|center|750px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 10&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Send Data to Display====&lt;br /&gt;
The VK16K33 datasheet explains how the sent data translates into certain segments being activated. This is outside the scope of this project, so for the sake of simplicity, we will skip the conversion. A full code sample is provided later in this project and can be reviewed for more information.&lt;br /&gt;
&lt;br /&gt;
====Turn On Display====&lt;br /&gt;
The display was previously turned on during the Power On Steps, so this step can be ignored.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
We don&#039;t have a cable handy for the connectors on this display, so we soldered wires directly to the exposed I2C pads. The product page for the display board provides the following pinout:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pads2.png|link=|75px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;C&#039;&#039;&#039; - SCL&lt;br /&gt;
*&#039;&#039;&#039;D&#039;&#039;&#039; - SDA&lt;br /&gt;
*&#039;&#039;&#039;3&#039;&#039;&#039; - 3.3V&lt;br /&gt;
*&#039;&#039;&#039;G&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can simply wire each of these to their corresponding terminal on the I2C Adapter Phidget. Note that your device&#039;s SCL may be labeled &amp;quot;SCK&amp;quot;, and the SDA pin may be &amp;quot;DIN&amp;quot; depending on which naming convention is used.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pinout.png|800px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x70. We can then queue up the commands we determined in the previous step.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/c/c9/I2C_Sensor_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
Since we have not sent any data to the RAM yet, the segments are uninitialized, with some on and some off:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_UnInit.png|800px|link=https://cdn.phidgets.com/docs/images/8/8c/I2C_Sensor_UnInit.png]]&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
To make the screen display &#039;&#039;&#039;PHID&#039;&#039;&#039;, we will first clear the screen with the following command:&lt;br /&gt;
*&#039;&#039;&#039;0x0000000000000000000000000000&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
We can then send the following data: &lt;br /&gt;
*&#039;&#039;&#039;0x003D000B00CA000C000300C30003&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Multisend.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now see the expected result:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Phid.png|800px|link=https://cdn.phidgets.com/docs/images/c/cd/I2C_Sensor_Phid.png]]&lt;br /&gt;
&lt;br /&gt;
===Reading Display RAM===&lt;br /&gt;
This display also supports reading the RAM, so you can programmatically know what&#039;s currently showing on the display. For most devices, this is as simple as providing the proper command and specifying a number of expected reply bytes. In this case, the device is expecting a stop condition in between the command and the data, as shown by the &#039;P&#039; in the third block in this diagram:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Read.png|850px|link=https://cdn.phidgets.com/docs/images/b/b4/I2C_Sensor_Read.png|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;From page 23 of the datasheet&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to replicate this in the control panel, we must send &#039;&#039;&#039;0x00&#039;&#039;&#039; first, and then send again with no data to listen for our reply bytes. &lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Panel_Read.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the Python code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    clear = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]&lt;br /&gt;
    phid = [0x00,0x3D,0x00,0x0B,0x00,0xCA,0x00,0x0C,0x00,0x03,0x00,0xC3,0x00,0x03]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp = DataAdapter()&lt;br /&gt;
    adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Set properties&lt;br /&gt;
    adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
    adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
    addr = 0x70&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Clear Screen&lt;br /&gt;
    adp.i2cSendReceive(addr, clear, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Initialize display&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Print PHID&lt;br /&gt;
    adp.i2cSendReceive(addr, phid, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        input(&amp;quot;Press Enter to Stop\n&amp;quot;)&lt;br /&gt;
    except (Exception, KeyboardInterrupt):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It will take input from the console and print scrolling messages on the display.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
ram = [&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
#   _ _ _ b _ _ _ &lt;br /&gt;
# | \     |     / |&lt;br /&gt;
# |  c    e    g  |&lt;br /&gt;
# l   \   |   /   d&lt;br /&gt;
# |    \  |  /    |&lt;br /&gt;
# | _ n _ _ _ a _ |&lt;br /&gt;
# |    /  |  \    |&lt;br /&gt;
# j   /   |   \   f&lt;br /&gt;
# |  m    k    i  |&lt;br /&gt;
# | /     |     \ |&lt;br /&gt;
# | _ _ _ h _ _ _ |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
letters = {&lt;br /&gt;
	#      abcdefghijklmn         abcdefghijklmn         abcdefghijklmn&lt;br /&gt;
	&amp;quot;A&amp;quot;: 0b11010100010101, &amp;quot;N&amp;quot;: 0b00110100110100, &amp;quot;0&amp;quot;: 0b01010111010110,&lt;br /&gt;
	&amp;quot;B&amp;quot;: 0b11011101001001, &amp;quot;O&amp;quot;: 0b01010101010100, &amp;quot;1&amp;quot;: 0b00010110000000,&lt;br /&gt;
	&amp;quot;C&amp;quot;: 0b01000001010100, &amp;quot;P&amp;quot;: 0b11010000010101, &amp;quot;2&amp;quot;: 0b11010001010001,&lt;br /&gt;
	&amp;quot;D&amp;quot;: 0b01011101001000, &amp;quot;Q&amp;quot;: 0b01010101110100, &amp;quot;3&amp;quot;: 0b11010101000001,&lt;br /&gt;
	&amp;quot;E&amp;quot;: 0b11000001010101, &amp;quot;R&amp;quot;: 0b11010000110101, &amp;quot;4&amp;quot;: 0b10010100000101,&lt;br /&gt;
	&amp;quot;F&amp;quot;: 0b11000000010101, &amp;quot;S&amp;quot;: 0b11100101000000, &amp;quot;5&amp;quot;: 0b11000101000101,&lt;br /&gt;
	&amp;quot;G&amp;quot;: 0b11000101010100, &amp;quot;T&amp;quot;: 0b01001000001000, &amp;quot;6&amp;quot;: 0b11000101010101,&lt;br /&gt;
	&amp;quot;H&amp;quot;: 0b10010100010101, &amp;quot;U&amp;quot;: 0b00010101010100, &amp;quot;7&amp;quot;: 0b01010100000000,&lt;br /&gt;
	&amp;quot;I&amp;quot;: 0b01001001001000, &amp;quot;V&amp;quot;: 0b00000010010110, &amp;quot;8&amp;quot;: 0b11010101010101,&lt;br /&gt;
	&amp;quot;J&amp;quot;: 0b00010101010000, &amp;quot;W&amp;quot;: 0b00010100110110, &amp;quot;9&amp;quot;: 0b11010100000101,&lt;br /&gt;
	&amp;quot;K&amp;quot;: 0b00000010110101, &amp;quot;X&amp;quot;: 0b00100010100010,&lt;br /&gt;
	&amp;quot;L&amp;quot;: 0b00000001010100, &amp;quot;Y&amp;quot;: 0b00100010001000,&lt;br /&gt;
	&amp;quot;M&amp;quot;: 0b00110110010100, &amp;quot;Z&amp;quot;: 0b01000011000010	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# loadRAM Reads all 13 bytes of of the screen memory into an array of 26 strings (for easier debugging)&lt;br /&gt;
# It should be loaded before overwriting a character, to preserve the other three.&lt;br /&gt;
def loadRAM(phid, addr):&lt;br /&gt;
	for i in range(13):&lt;br /&gt;
		byte = format(phid.i2cSendReceive(addr,[i],1)[0],&#039;08b&#039;)&lt;br /&gt;
		ram[(i*2)] = byte[:4]&lt;br /&gt;
		ram[(i*2)+1] = byte[4:]&lt;br /&gt;
&lt;br /&gt;
# printMessage prints a scrolling marquee messasge &#039;str&#039;&lt;br /&gt;
def printMessage(str, phid, addr):&lt;br /&gt;
	# Add four spaces to ensure the message scrolls off&lt;br /&gt;
	str += &amp;quot;    &amp;quot;&lt;br /&gt;
	a0 = a1 = a2 = a3 = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	for a in str:&lt;br /&gt;
		a0 = a1&lt;br /&gt;
		a1 = a2&lt;br /&gt;
		a2 = a3&lt;br /&gt;
		a3 = a.upper()&lt;br /&gt;
		clearScreen(phid,addr)&lt;br /&gt;
		printLetter(a0, phid, addr, 0)&lt;br /&gt;
		printLetter(a1, phid, addr, 1)&lt;br /&gt;
		printLetter(a2, phid, addr, 2)&lt;br /&gt;
		printLetter(a3, phid, addr, 3)&lt;br /&gt;
		time.sleep(0.08)&lt;br /&gt;
&lt;br /&gt;
# printLetter prints letter &#039;a&#039; to position &#039;pos&#039;&lt;br /&gt;
def printLetter(a, phid, addr,pos):&lt;br /&gt;
&lt;br /&gt;
	# Confirm parameters are valid&lt;br /&gt;
	if a not in letters or (pos &amp;gt; 3) or (pos &amp;lt; 0):&lt;br /&gt;
		return&lt;br /&gt;
	&lt;br /&gt;
	# Get the segments required for the letter&lt;br /&gt;
	bits = [(letters[a] &amp;gt;&amp;gt; bit) &amp;amp; 1 for bit in range(13,-1,-1)]&lt;br /&gt;
&lt;br /&gt;
	# For each segment, AND or OR it to the existing memory to preseve the other three digits&lt;br /&gt;
	# It had to be broken into two in order to skip over other bytes in the memory string.&lt;br /&gt;
	# The memory string is laid out like this: 00ab0:cd0.ef00gh00ij00kl00mn&lt;br /&gt;
	# Where &#039;:&#039; turns on the center colon and &#039;.&#039; turns on the decimal point when 0001 is written there.&lt;br /&gt;
	for i in range(7):&lt;br /&gt;
		if bits[2*i] == 0:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		if bits[(2*i)+1] == 0:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	hex = bytes(&lt;br /&gt;
		(int(ram[i], 2) &amp;lt;&amp;lt; 4) | int(ram[i+1], 2)&lt;br /&gt;
		for i in range(0, 26, 2)&lt;br /&gt;
	)&lt;br /&gt;
	hex = list(hex)&lt;br /&gt;
	hex.insert(0,0x00) # add the leading 0x00 for writing&lt;br /&gt;
	phid.i2cSendReceive(addr, hex, 0)&lt;br /&gt;
&lt;br /&gt;
# clearScreen clears the screen and the ram array&lt;br /&gt;
def clearScreen(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00], 0)&lt;br /&gt;
	loadRAM(phid,addr)&lt;br /&gt;
&lt;br /&gt;
# initialize sets the clock, brightness and blinking so the screen can operate&lt;br /&gt;
def initialize(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	# Declare and open dataAdapter channel&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x70&lt;br /&gt;
&lt;br /&gt;
	# Clear Screen&lt;br /&gt;
	clearScreen(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	# Initialize display&lt;br /&gt;
	initialize(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	print(&amp;quot;Type a message to display, or &#039;exit&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	message = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	while message != &amp;quot;exit&amp;quot;:&lt;br /&gt;
		try:&lt;br /&gt;
			message = input()&lt;br /&gt;
			printMessage(message,adp,addr)&lt;br /&gt;
		except (Exception, KeyboardInterrupt):&lt;br /&gt;
			pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35597</id>
		<title>Controlling an I2C Display</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Controlling_an_I2C_Display&amp;diff=35597"/>
		<updated>2026-04-13T15:11:21Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Writing a Custom Python Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;A step-by-step example writing code to interface a sensor with the ADP0001.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
[[Image:ADP0001_0_169.jpg|link=https://cdn.phidgets.com/docs/images/f/f5/ADP0001_0_169.jpg|thumb| 450px|&amp;lt;center&amp;gt;[https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget (ADP0001_0)]]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1354 I2C Adapter Phidget] allows you to interface with a wide range of I2C-compatible devices, including sensors, displays, and more. &lt;br /&gt;
&lt;br /&gt;
In this project, we will use it to control a 14-segment alphanumeric display.&lt;br /&gt;
&lt;br /&gt;
===Steps===&lt;br /&gt;
To complete this project, we will work through the following steps:&lt;br /&gt;
# Determine the device&#039;s basic configuration parameters&lt;br /&gt;
# Identify the sequence of commands expected by the device&lt;br /&gt;
# Connect the device to the I2C Adapter Phidget&lt;br /&gt;
# Test the device using the Phidget Control Panel&lt;br /&gt;
# Create a custom program.&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
Information from the following resources will be referenced throughout this project.&lt;br /&gt;
* [https://www.sparkfun.com/sparkfun-qwiic-alphanumeric-display-red.html Device Product Page]&lt;br /&gt;
* [https://cdn.phidgets.com/docs/images/7/7b/VK16K33.pdf VK16K33 LED Driver IC Datasheet]&lt;br /&gt;
&lt;br /&gt;
==Demonstration==&lt;br /&gt;
&amp;lt;center&amp;gt;{{#ev:youtube|x2YtRTRMybw|rel=0}}&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuration Parameters==&lt;br /&gt;
[[Image:Adp0002_an_productpage2.png|link=https://cdn.phidgets.com/docs/images/2/26/Adp0002_an_productpage2.png|thumb|&amp;lt;center&amp;gt;Product page features&amp;lt;/center&amp;gt;]]&lt;br /&gt;
[[Image:I2C_Sensor_Freq.png|thumb|link=https://cdn.phidgets.com/docs/images/5/59/I2C_Sensor_Freq.png|&amp;lt;center&amp;gt;VK16K33 datasheet (Page 29)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
During this step, we are looking for the following information:&lt;br /&gt;
* Supply Voltage&lt;br /&gt;
* Communication Frequency&lt;br /&gt;
* Device Address&lt;br /&gt;
&lt;br /&gt;
This information is typically found using the device&#039;s product page and/or any relevant datasheets. Based on these resources, we will use the following parameters:&lt;br /&gt;
* Supply Voltage: 3.3V*&lt;br /&gt;
* Communication Frequency: 400kHz&lt;br /&gt;
* I2C Address: 0x70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&#039;&#039;The datasheet specifies an operating voltage of 4.5-5V, however, this applies only when the chip is powered directly. The breakout board includes an onboard 3.3V to 5V boost circuit, which provides the required operating voltage for the chip.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Command Sequence==&lt;br /&gt;
Next, we need to determine the sequence of commands the device is expecting. The VK16K33 datasheet provides flowcharts that we can use to create a list of actions:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_flow.png|link=https://cdn.phidgets.com/docs/images/a/a8/Adp0002_an_flow.png|750px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Adapted from datasheet (page 26)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Based on the flowcharts, our list of actions should look like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Power On Steps&#039;&#039;&#039;:&lt;br /&gt;
# Enable the internal system clock&lt;br /&gt;
# Set the dimming register&lt;br /&gt;
# Set the blinking register&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt; &#039;&#039;The ROW/INT step is ignored because the feature is not being used.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Display Steps&#039;&#039;&#039;&lt;br /&gt;
# Set the write address&lt;br /&gt;
# Send the data to display&lt;br /&gt;
# Turn on the display&lt;br /&gt;
&lt;br /&gt;
===Writing to VK16K33 Registers===&lt;br /&gt;
I2C devices typically expect the following format:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_typicalcomms3.png|link=https://cdn.phidgets.com/docs/images/2/29/Adp0002_an_typicalcomms3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The VK16K33 instead expects the following format, where the register address and data is combined into a single byte:&lt;br /&gt;
&lt;br /&gt;
[[Image:Adp0002_an_VK16K33comms4.png|link=https://cdn.phidgets.com/docs/images/c/c5/Adp0002_an_VK16K33comms4.png|400px]]&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
====Enable the System Clock====&lt;br /&gt;
The system clock (oscillator) is managed by register &#039;&#039;&#039;0x20&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_SysClock.png|link=https://cdn.phidgets.com/docs/images/d/d7/I2C_Sensor_SysClock.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 7)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This register only has one relevant bit, the &#039;&#039;&#039;S&#039;&#039;&#039; bit in position &#039;&#039;&#039;D8&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;0010 0001&#039;&#039;&#039; (0x21 in hexadecimal), the system clock will be enabled. Bits marked with an &#039;&#039;&#039;X&#039;&#039;&#039; are irrelevant and can be set to either 0 or 1 with no impact.&lt;br /&gt;
&lt;br /&gt;
====Set Dimming Register====&lt;br /&gt;
Dimming is managed by register &#039;&#039;&#039;0xEF&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_dimmingreg.png|link=https://cdn.phidgets.com/docs/images/3/30/Adp0002_an_dimmingreg.png|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;VK16K33 datasheet (page 25)&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The register has four relevant bits, &#039;&#039;&#039;P0 through P3&#039;&#039;&#039;, in positions &#039;&#039;&#039;D8 through D11&#039;&#039;&#039;. These bits are used to set the duty cycle of the display, which allows for fine control of brightness. By sending the command &#039;&#039;&#039;1110 1111&#039;&#039;&#039; (0xEF in hexadecimal), maximum brightness is selected.&lt;br /&gt;
&lt;br /&gt;
====Set Blinking Register====&lt;br /&gt;
The blinking frequency and display state is managed by register &#039;&#039;&#039;0x80&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Blink.png|link=|center|850px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 9&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are three relevant bits in this register: &#039;&#039;&#039;D&#039;&#039;&#039;, &#039;&#039;&#039;B0&#039;&#039;&#039;, and &#039;&#039;&#039;B1&#039;&#039;&#039; in positions &#039;&#039;&#039;D8 through D10&#039;&#039;&#039;. By sending the command &#039;&#039;&#039;1000 0001&#039;&#039;&#039; (0x81 in hexadecimal), the display will be turned on, and blinking will be set to off.&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
====Set the Write Address====&lt;br /&gt;
The display RAM is 16 bytes and begins at address &#039;&#039;&#039;0x00&#039;&#039;&#039;:&lt;br /&gt;
[[Image:Adp0002_an_ram.png|link=https://cdn.phidgets.com/docs/images/b/bd/Adp0002_an_ram.png|center|750px]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Datasheet page 10&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Send Data to Display====&lt;br /&gt;
The VK16K33 datasheet explains how the sent data translates into certain segments being activated. This is outside the scope of this project, so for the sake of simplicity, we will skip the conversion. A full code sample is provided later in this project and can be reviewed for more information.&lt;br /&gt;
&lt;br /&gt;
====Turn On Display====&lt;br /&gt;
The display was previously turned on during the Power On Steps, so this step can be ignored.&lt;br /&gt;
&lt;br /&gt;
== Connecting to the ADP0001 ==&lt;br /&gt;
&lt;br /&gt;
We don&#039;t have a cable handy for the connectors on this display, so we soldered wires directly to the exposed I2C pads. The product page for the display board provides the following pinout:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pads2.png|link=|75px|left]]&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;C&#039;&#039;&#039; - SCL&lt;br /&gt;
*&#039;&#039;&#039;D&#039;&#039;&#039; - SDA&lt;br /&gt;
*&#039;&#039;&#039;3&#039;&#039;&#039; - 3.3V&lt;br /&gt;
*&#039;&#039;&#039;G&#039;&#039;&#039; - GND&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can simply wire each of these to their corresponding terminal on the I2C Adapter Phidget. Note that your device&#039;s SCL may be labeled &amp;quot;SCK&amp;quot;, and the SDA pin may be &amp;quot;DIN&amp;quot; depending on which naming convention is used.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_display_pinout.png|800px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Testing in the Phidget Control Panel==&lt;br /&gt;
Now that we have the configuration parameters and the command sequence, we can use the Phidget Control Panel to confirm our device is working as expected.&lt;br /&gt;
&lt;br /&gt;
===Power On Steps===&lt;br /&gt;
We can set the voltage to 3.3V, the frequency to 400kHz, and the address to 0x70. We can then queue up the commands we determined in the previous step.&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_ControlPanel2.png|link=https://cdn.phidgets.com/docs/images/c/c9/I2C_Sensor_ControlPanel2.png|center]]&lt;br /&gt;
&lt;br /&gt;
Since we have not sent any data to the RAM yet, the segments are uninitialized, with some on and some off:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_UnInit.png|800px|link=https://cdn.phidgets.com/docs/images/8/8c/I2C_Sensor_UnInit.png]]&lt;br /&gt;
&lt;br /&gt;
===Display Steps===&lt;br /&gt;
To make the screen display &#039;&#039;&#039;PHID&#039;&#039;&#039;, we will first clear the screen with the following command:&lt;br /&gt;
*&#039;&#039;&#039;0x0000000000000000000000000000&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
We can then send the following data: &lt;br /&gt;
*&#039;&#039;&#039;0x003D000B00CA000C000300C30003&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Multisend.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can now see the expected result:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Phid.png|800px|link=https://cdn.phidgets.com/docs/images/c/cd/I2C_Sensor_Phid.png]]&lt;br /&gt;
&lt;br /&gt;
===Reading Display RAM===&lt;br /&gt;
This display also supports reading the RAM, so you can programmatically know what&#039;s currently showing on the display. For most devices, this is as simple as providing the proper command and specifying a number of expected reply bytes. In this case, the device is expecting a stop condition in between the command and the data, as shown by the &#039;P&#039; in the third block in this diagram:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Sensor_Read.png|850px|link=https://cdn.phidgets.com/docs/images/b/b4/I2C_Sensor_Read.png|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;From page 23 of the datasheet&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to replicate this in the control panel, we must send &#039;&#039;&#039;0x00&#039;&#039;&#039; first, and then send again with no data to listen for our reply bytes. &lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Panel_Read.png|850px|link=]]&lt;br /&gt;
&lt;br /&gt;
==Writing a Custom Program==&lt;br /&gt;
To begin writing a custom program for your Phidget device, navigate to the product page and select the [https://www.phidgets.com/?prodid=1354#Tab_Code_Samples Code Samples tab]. From there, you can customize the code for your own purposes. Here we have modified the code sample to match our steps from the Phidget Control Panel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    clear = [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]&lt;br /&gt;
    phid = [0x00,0x3D,0x00,0x0B,0x00,0xCA,0x00,0x0C,0x00,0x03,0x00,0xC3,0x00,0x03]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp = DataAdapter()&lt;br /&gt;
    adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Set properties&lt;br /&gt;
    adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
    adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
    addr = 0x70&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Clear Screen&lt;br /&gt;
    adp.i2cSendReceive(addr, clear, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Initialize display&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
    adp.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    # Print PHID&lt;br /&gt;
    adp.i2cSendReceive(addr, phid, 0)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    try:&lt;br /&gt;
        input(&amp;quot;Press Enter to Stop\n&amp;quot;)&lt;br /&gt;
    except (Exception, KeyboardInterrupt):&lt;br /&gt;
        pass&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    adp.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That’s about it, we went from reading the datasheet to a working script. Not all datasheets are created equal, so if you’re struggling with getting your sensor set up, feel free to ask for help by [https://www.phidgets.com/?view=contact sending us an email].&lt;br /&gt;
&lt;br /&gt;
===Full Script===&lt;br /&gt;
Here is the full Python script that was used in the demonstration video. It will take input from the console and print scrolling messages on the display.&lt;br /&gt;
&lt;br /&gt;
{{UGC-Start}}&lt;br /&gt;
{{UGC-Entry|Full Script (Click to expand)||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DataAdapter import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
ram = [&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;,&amp;quot;0000&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
#   _ _ _ b _ _ _ &lt;br /&gt;
# | \     |     / |&lt;br /&gt;
# |  c    e    g  |&lt;br /&gt;
# l   \   |   /   d&lt;br /&gt;
# |    \  |  /    |&lt;br /&gt;
# | _ n _ _ _ a _ |&lt;br /&gt;
# |    /  |  \    |&lt;br /&gt;
# j   /   |   \   f&lt;br /&gt;
# |  m    k    i  |&lt;br /&gt;
# | /     |     \ |&lt;br /&gt;
# | _ _ _ h _ _ _ |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
letters = {&lt;br /&gt;
	#      abcdefghijklmn         abcdefghijklmn         abcdefghijklmn&lt;br /&gt;
	&amp;quot;A&amp;quot;: 0b11010100010101, &amp;quot;N&amp;quot;: 0b00110100110100, &amp;quot;0&amp;quot;: 0b01010111010110,&lt;br /&gt;
	&amp;quot;B&amp;quot;: 0b11011101001001, &amp;quot;O&amp;quot;: 0b01010101010100, &amp;quot;1&amp;quot;: 0b00010110000000,&lt;br /&gt;
	&amp;quot;C&amp;quot;: 0b01000001010100, &amp;quot;P&amp;quot;: 0b11010000010101, &amp;quot;2&amp;quot;: 0b11010001010001,&lt;br /&gt;
	&amp;quot;D&amp;quot;: 0b01011101001000, &amp;quot;Q&amp;quot;: 0b01010101110100, &amp;quot;3&amp;quot;: 0b11010101000001,&lt;br /&gt;
	&amp;quot;E&amp;quot;: 0b11000001010101, &amp;quot;R&amp;quot;: 0b11010000110101, &amp;quot;4&amp;quot;: 0b10010100000101,&lt;br /&gt;
	&amp;quot;F&amp;quot;: 0b11000000010101, &amp;quot;S&amp;quot;: 0b11100101000000, &amp;quot;5&amp;quot;: 0b11000101000101,&lt;br /&gt;
	&amp;quot;G&amp;quot;: 0b11000101010100, &amp;quot;T&amp;quot;: 0b01001000001000, &amp;quot;6&amp;quot;: 0b11000101010101,&lt;br /&gt;
	&amp;quot;H&amp;quot;: 0b10010100010101, &amp;quot;U&amp;quot;: 0b00010101010100, &amp;quot;7&amp;quot;: 0b01010100000000,&lt;br /&gt;
	&amp;quot;I&amp;quot;: 0b01001001001000, &amp;quot;V&amp;quot;: 0b00000010010110, &amp;quot;8&amp;quot;: 0b11010101010101,&lt;br /&gt;
	&amp;quot;J&amp;quot;: 0b00010101010000, &amp;quot;W&amp;quot;: 0b00010100110110, &amp;quot;9&amp;quot;: 0b11010100000101,&lt;br /&gt;
	&amp;quot;K&amp;quot;: 0b00000010110101, &amp;quot;X&amp;quot;: 0b00100010100010,&lt;br /&gt;
	&amp;quot;L&amp;quot;: 0b00000001010100, &amp;quot;Y&amp;quot;: 0b00100010001000,&lt;br /&gt;
	&amp;quot;M&amp;quot;: 0b00110110010100, &amp;quot;Z&amp;quot;: 0b01000011000010	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# loadRAM Reads all 13 bytes of of the screen memory into an array of 26 strings (for easier debugging)&lt;br /&gt;
# It should be loaded before overwriting a character, to preserve the other three.&lt;br /&gt;
def loadRAM(phid, addr):&lt;br /&gt;
	for i in range(13):&lt;br /&gt;
		byte = format(phid.i2cSendReceive(addr,[i],1)[0],&#039;08b&#039;)&lt;br /&gt;
		ram[(i*2)] = byte[:4]&lt;br /&gt;
		ram[(i*2)+1] = byte[4:]&lt;br /&gt;
&lt;br /&gt;
# printMessage prints a scrolling marquee messasge &#039;str&#039;&lt;br /&gt;
def printMessage(str, phid, addr):&lt;br /&gt;
	# Add four spaces to ensure the message scrolls off&lt;br /&gt;
	str += &amp;quot;    &amp;quot;&lt;br /&gt;
	a0 = a1 = a2 = a3 = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	for a in str:&lt;br /&gt;
		a0 = a1&lt;br /&gt;
		a1 = a2&lt;br /&gt;
		a2 = a3&lt;br /&gt;
		a3 = a.upper()&lt;br /&gt;
		clearScreen(phid,addr)&lt;br /&gt;
		printLetter(a0, phid, addr, 0)&lt;br /&gt;
		printLetter(a1, phid, addr, 1)&lt;br /&gt;
		printLetter(a2, phid, addr, 2)&lt;br /&gt;
		printLetter(a3, phid, addr, 3)&lt;br /&gt;
		time.sleep(0.08)&lt;br /&gt;
&lt;br /&gt;
# printLetter prints letter &#039;a&#039; to position &#039;pos&#039;&lt;br /&gt;
def printLetter(a, phid, addr,pos):&lt;br /&gt;
&lt;br /&gt;
	# Confirm parameters are valid&lt;br /&gt;
	if a not in letters or (pos &amp;gt; 3) or (pos &amp;lt; 0):&lt;br /&gt;
		return&lt;br /&gt;
	&lt;br /&gt;
	# Get the segments required for the letter&lt;br /&gt;
	bits = [(letters[a] &amp;gt;&amp;gt; bit) &amp;amp; 1 for bit in range(13,-1,-1)]&lt;br /&gt;
&lt;br /&gt;
	# For each segment, AND or OR it to the existing memory to preseve the other three digits&lt;br /&gt;
	# It had to be broken into two in order to skip over other bytes in the memory string.&lt;br /&gt;
	# The memory string is laid out like this: 00ab0:cd0.ef00gh00ij00kl00mn&lt;br /&gt;
	# Where &#039;:&#039; turns on the center colon and &#039;.&#039; turns on the decimal point when 0001 is written there.&lt;br /&gt;
	for i in range(7):&lt;br /&gt;
		if bits[2*i] == 0:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[4*i], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[4*i] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		if bits[(2*i)+1] == 0:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp &amp;amp;= ~(1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
		else:&lt;br /&gt;
			tmp = int(ram[(4*i)+1], 2)&lt;br /&gt;
			tmp |= (1 &amp;lt;&amp;lt; pos)&lt;br /&gt;
			ram[(4*i)+1] = f&amp;quot;{tmp:04b}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	hex = bytes(&lt;br /&gt;
		(int(ram[i], 2) &amp;lt;&amp;lt; 4) | int(ram[i+1], 2)&lt;br /&gt;
		for i in range(0, 26, 2)&lt;br /&gt;
	)&lt;br /&gt;
	hex = list(hex)&lt;br /&gt;
	hex.insert(0,0x00) # add the leading 0x00 for writing&lt;br /&gt;
	phid.i2cSendReceive(addr, hex, 0)&lt;br /&gt;
&lt;br /&gt;
# clearScreen clears the screen and the ram array&lt;br /&gt;
def clearScreen(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00], 0)&lt;br /&gt;
	loadRAM(phid,addr)&lt;br /&gt;
&lt;br /&gt;
# initialize sets the clock, brightness and blinking so the screen can operate&lt;br /&gt;
def initialize(phid,addr):&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x21], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0xEF], 0)&lt;br /&gt;
	phid.i2cSendReceive(addr, [0x81], 0)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
&lt;br /&gt;
	# Declare and open dataAdapter channel&lt;br /&gt;
	adp = DataAdapter()&lt;br /&gt;
	adp.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
	# Set properties&lt;br /&gt;
	adp.setFrequency(DataAdapterFrequency.FREQUENCY_400kHz)&lt;br /&gt;
	adp.setDataAdapterVoltage(DataAdapterVoltage.DATAADAPTER_VOLTAGE_3_3V)&lt;br /&gt;
	addr = 0x70&lt;br /&gt;
&lt;br /&gt;
	# Clear Screen&lt;br /&gt;
	clearScreen(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	# Initialize display&lt;br /&gt;
	initialize(adp,addr)&lt;br /&gt;
&lt;br /&gt;
	print(&amp;quot;Type a message to display, or &#039;exit&#039; to quit.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	message = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	while message != &amp;quot;exit&amp;quot;:&lt;br /&gt;
		try:&lt;br /&gt;
			message = input()&lt;br /&gt;
			printMessage(message,adp,addr)&lt;br /&gt;
		except (Exception, KeyboardInterrupt):&lt;br /&gt;
			pass&lt;br /&gt;
&lt;br /&gt;
	adp.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{UGC-End}}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35596</id>
		<title>I2C Adapter API Guide</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35596"/>
		<updated>2026-04-09T19:50:44Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* I2CSendReceive() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Get started with your I2C Adapter Phidget}}&lt;br /&gt;
[[Category:IntroGuide]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;nonumtoc&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toclimit-4&amp;quot;&amp;gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[Image:ADP0001_0.jpg|thumb|&amp;lt;center&amp;gt;I2C Adapter Phidget (ADP0001_0)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
This guide will provide information about the DataAdapter API to get you up and running with your new I2C Adapter Phidget.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before starting this guide, visit the Quick Start Guide on your I2C Adapter Phidget&#039;s product page for information about wiring.&lt;br /&gt;
&lt;br /&gt;
== Address Format ==&lt;br /&gt;
&lt;br /&gt;
The I2C Adapter Phidget interprets the device address as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Addr.png|link=|550px]]&lt;br /&gt;
&lt;br /&gt;
The read/write bit is not included in the hexadecimal value for the address, as this bit is handled by the API calls. &lt;br /&gt;
You may find that datasheets for some I2C devices include the read/write bit, so a read-only device like a simple temperature sensor might specify the address as &#039;&#039;&#039;0xE3&#039;&#039;&#039; instead of &#039;&#039;&#039;0x71&#039;&#039;&#039; in this case. When using such a sensor, be sure to ignore the R/W bit and shift the remaining seven bits down to get the address you need to send to Phidgets API calls.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== I2CSendReceive() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
* int &#039;&#039;&#039;receiveLength&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the main function you&#039;ll use for simple read and write operations. &lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is the data array, which can contain up to 127 bytes. If the data array is empty, the I2C Adapter Phidget will skip sending the write address and bytes. &lt;br /&gt;
* The third parameter is the receive length, or the number of bytes you&#039;re expecting back from the device for this transaction. Maximum receive length is 127, and if it&#039;s zero the I2C Adapter Phidget will skip sending the read address and bytes. &lt;br /&gt;
&lt;br /&gt;
This diagram illustrates the data structure when using {{Code|I2CSendReceive}}:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_SendRecv.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;S&#039;&#039;&#039;&#039; represents a start condition, while &#039;&#039;&#039;&#039;P&#039;&#039;&#039;&#039; represents a stop condition. If your I2C device requires data in a different structure than this, you may need to use {{Code|I2CComplexTransaction()}}, as explained in the next section.&lt;br /&gt;
&lt;br /&gt;
=== I2CComplexTransaction() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* string &#039;&#039;&#039;I2CPacketString&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function gives you more control over the read/write structure for more complex interactions. This is useful for longer commands that make use of repeated start conditions.&lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is a string that dictates the read/write sequence to follow.&lt;br /&gt;
* The third parameter is the data array, whose length must match the number of writes in the string, up to 127 bytes.&lt;br /&gt;
&lt;br /&gt;
The string is made up of the following characters, case-sensitive with no spaces:&lt;br /&gt;
* &#039;&#039;&#039;&#039;s&#039;&#039;&#039;&#039; for a start condition&lt;br /&gt;
* &#039;&#039;&#039;&#039;R&#039;&#039;&#039;&#039; for a read byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;T&#039;&#039;&#039;&#039; for a write byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;p&#039;&#039;&#039;&#039; for a stop condition&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Complex.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
Numerals can also be used after a &#039;T&#039; or &#039;R&#039; to make the string compact. In this example, the data array would need to have a length of 3, since a total of three bytes are written in the sequence.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35595</id>
		<title>I2C Adapter API Guide</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35595"/>
		<updated>2026-04-09T19:44:04Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Get started with your I2C Adapter Phidget}}&lt;br /&gt;
[[Category:IntroGuide]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;nonumtoc&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toclimit-4&amp;quot;&amp;gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[Image:ADP0001_0.jpg|thumb|&amp;lt;center&amp;gt;I2C Adapter Phidget (ADP0001_0)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
This guide will provide information about the DataAdapter API to get you up and running with your new I2C Adapter Phidget.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before starting this guide, visit the Quick Start Guide on your I2C Adapter Phidget&#039;s product page for information about wiring.&lt;br /&gt;
&lt;br /&gt;
== Address Format ==&lt;br /&gt;
&lt;br /&gt;
The I2C Adapter Phidget interprets the device address as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Addr.png|link=|550px]]&lt;br /&gt;
&lt;br /&gt;
The read/write bit is not included in the hexadecimal value for the address, as this bit is handled by the API calls. &lt;br /&gt;
You may find that datasheets for some I2C devices include the read/write bit, so a read-only device like a simple temperature sensor might specify the address as &#039;&#039;&#039;0xE3&#039;&#039;&#039; instead of &#039;&#039;&#039;0x71&#039;&#039;&#039; in this case. When using such a sensor, be sure to ignore the R/W bit and shift the remaining seven bits down to get the address you need to send to Phidgets API calls.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== I2CSendReceive() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
* int &#039;&#039;&#039;receiveLength&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the main function you&#039;ll use for simple read and write operations. &lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is the data array, which can contain up to 127 bytes. If the data array is empty, the I2C Adapter Phidget will skip sending the write address and bytes. &lt;br /&gt;
* The third parameter is the receive length, or the number of bytes you&#039;re expecting back from the device for this transaction. Maximum receive length is 127, and if it&#039;s zero the I2C Adapter Phidget will skip sending the read address and bytes. &lt;br /&gt;
&lt;br /&gt;
This diagram illustrates the data structure when using {{Code|I2CSendReceive}}:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_SendRecv.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;S&#039;&#039;&#039;&#039; represents a start condition, while &#039;&#039;&#039;&#039;P&#039;&#039;&#039;&#039; represents a stop condition. If your I2C device requires data in a different structure than this, you may need to use {{Code|I2CComplexTransaction()}}, as explained in the next section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I2CComplexTransaction() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* string &#039;&#039;&#039;I2CPacketString&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function gives you more control over the read/write structure for more complex interactions. This is useful for longer commands that make use of repeated start conditions.&lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is a string that dictates the read/write sequence to follow.&lt;br /&gt;
* The third parameter is the data array, whose length must match the number of writes in the string, up to 127 bytes.&lt;br /&gt;
&lt;br /&gt;
The string is made up of the following characters, case-sensitive with no spaces:&lt;br /&gt;
* &#039;&#039;&#039;&#039;s&#039;&#039;&#039;&#039; for a start condition&lt;br /&gt;
* &#039;&#039;&#039;&#039;R&#039;&#039;&#039;&#039; for a read byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;T&#039;&#039;&#039;&#039; for a write byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;p&#039;&#039;&#039;&#039; for a stop condition&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Complex.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
Numerals can also be used after a &#039;T&#039; or &#039;R&#039; to make the string compact. In this example, the data array would need to have a length of 3, since a total of three bytes are written in the sequence.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35594</id>
		<title>I2C Adapter API Guide</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=I2C_Adapter_API_Guide&amp;diff=35594"/>
		<updated>2026-04-09T19:43:28Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Get started with your I2C Adapter Phidget}}&lt;br /&gt;
[[Category:IntroGuide]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;nonumtoc&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;toclimit-4&amp;quot;&amp;gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
[[Image:ADP0001_0.jpg|thumb|&amp;lt;center&amp;gt;I2C Adapter Phidget (ADP0001_0)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
This guide will provide information about the DataAdapter API to get you up and running with your new I2C Adapter Phidget.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Before starting this guide, visit the Quick Start Guide on your Adapter Phidget&#039;s product page for information about wiring.&lt;br /&gt;
&lt;br /&gt;
== Address Format ==&lt;br /&gt;
&lt;br /&gt;
The I2C Adapter Phidget interprets the device address as follows:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Addr.png|link=|550px]]&lt;br /&gt;
&lt;br /&gt;
The read/write bit is not included in the hexadecimal value for the address, as this bit is handled by the API calls. &lt;br /&gt;
You may find that datasheets for some I2C devices include the read/write bit, so a read-only device like a simple temperature sensor might specify the address as &#039;&#039;&#039;0xE3&#039;&#039;&#039; instead of &#039;&#039;&#039;0x71&#039;&#039;&#039; in this case. When using such a sensor, be sure to ignore the R/W bit and shift the remaining seven bits down to get the address you need to send to Phidgets API calls.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== I2CSendReceive() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
* int &#039;&#039;&#039;receiveLength&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is the main function you&#039;ll use for simple read and write operations. &lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is the data array, which can contain up to 127 bytes. If the data array is empty, the I2C Adapter Phidget will skip sending the write address and bytes. &lt;br /&gt;
* The third parameter is the receive length, or the number of bytes you&#039;re expecting back from the device for this transaction. Maximum receive length is 127, and if it&#039;s zero the I2C Adapter Phidget will skip sending the read address and bytes. &lt;br /&gt;
&lt;br /&gt;
This diagram illustrates the data structure when using {{Code|I2CSendReceive}}:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_SendRecv.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;S&#039;&#039;&#039;&#039; represents a start condition, while &#039;&#039;&#039;&#039;P&#039;&#039;&#039;&#039; represents a stop condition. If your I2C device requires data in a different structure than this, you may need to use {{Code|I2CComplexTransaction()}}, as explained in the next section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I2CComplexTransaction() ===&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* int &#039;&#039;&#039;address&#039;&#039;&#039;&lt;br /&gt;
* string &#039;&#039;&#039;I2CPacketString&#039;&#039;&#039;&lt;br /&gt;
* byte[ ] &#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function gives you more control over the read/write structure for more complex interactions. This is useful for longer commands that make use of repeated start conditions.&lt;br /&gt;
&lt;br /&gt;
* The first parameter is the I2C address of your device, usually specified in the datasheet or printed on the circuit board. &lt;br /&gt;
* The second parameter is a string that dictates the read/write sequence to follow.&lt;br /&gt;
* The third parameter is the data array, whose length must match the number of writes in the string, up to 127 bytes.&lt;br /&gt;
&lt;br /&gt;
The string is made up of the following characters, case-sensitive with no spaces:&lt;br /&gt;
* &#039;&#039;&#039;&#039;s&#039;&#039;&#039;&#039; for a start condition&lt;br /&gt;
* &#039;&#039;&#039;&#039;R&#039;&#039;&#039;&#039; for a read byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;T&#039;&#039;&#039;&#039; for a write byte&lt;br /&gt;
* &#039;&#039;&#039;&#039;p&#039;&#039;&#039;&#039; for a stop condition&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example:&lt;br /&gt;
&lt;br /&gt;
[[Image:I2C_Complex.png|link=|850px]]&lt;br /&gt;
&lt;br /&gt;
Numerals can also be used after a &#039;T&#039; or &#039;R&#039; to make the string compact. In this example, the data array would need to have a length of 3, since a total of three bytes are written in the sequence.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:ADP0001_0.jpg&amp;diff=35593</id>
		<title>File:ADP0001 0.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:ADP0001_0.jpg&amp;diff=35593"/>
		<updated>2026-04-09T19:42:20Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35586</id>
		<title>Language - Java</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35586"/>
		<updated>2026-04-02T16:40:00Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Deploying Applications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with Java.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22 library, it&#039;s easy to create Java applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==Java Libraries==&lt;br /&gt;
During development, we recommend downloading the appropriate installer or package for your [https://www.phidgets.com/docs/Operating_System_Support operating system]. This will place the required Phidget library files in standard locations where Java will look for them. When [[#Deploying Applications|deploying applications]], you can instead include these files manually as part of your application. &lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_Udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
&lt;br /&gt;
Before choosing a development environment, make sure you have the [http://www.oracle.com/technetwork/java/index.html Java Development Kit] installed. &lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start developing with Java in VSCode, open it up and install the &#039;&#039;&#039;Extension Pack for Java&#039;&#039;&#039;.||[[Image:Language_java_vscode_extension2.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b4/Language_java_vscode_extension2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, press &#039;&#039;&#039;Ctrl+Shift+P&#039;&#039;&#039; to open the command palette, type &amp;quot;java&amp;quot; and select &#039;&#039;&#039;Java: Create Java Project&#039;&#039;&#039;.  || [[Image:Language_java_vscode_createproj.png|center|360px|link=https://cdn.phidgets.com/docs/images/7/78/Language_java_vscode_createproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Select &amp;quot;No Build Tools&amp;quot; and select a directory for the new project. You&#039;ll be asked for a project name, and  VSCode will create the directory structure. || [[Image:Language_java_vscode_emptyproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/c1/Language_java_vscode_emptyproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|You&#039;ll need to get a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; to put inside the &amp;quot;lib&amp;quot; folder. [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here]. &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now begin writing code in the newly created &amp;quot;App.java&amp;quot; file, or you can download a [[#Example_Code|sample program]] for your device and place it in the &amp;quot;src&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| Compile and run by pressing &#039;&#039;&#039;F5&#039;&#039;&#039; or by clicking the play button in the top right. || [[Image:Language_java_vscode_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/e/ea/Language_java_vscode_run.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, click on the &#039;&#039;&#039;Java Projects&#039;&#039;&#039; section in the explorer. || [[Image:Language_java_vscode_jar.png|center|350px|link=https://cdn.phidgets.com/docs/images/6/65/Language_java_vscode_jar.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Click on the export icon, and then select your main class and click OK. || [[Image:Language_java_vscode_jar2.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/74/Language_java_vscode_jar2.png]]&lt;br /&gt;
|- &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Now you can run your new .jar file with the following command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar Example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Javac===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|To run your program, enter the following command in the command prompt or terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
javac -classpath .;phidget22.jar example.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, enter the following command to run the program:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -classpath .;phidget22.jar example &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Once you&#039;re ready to compile your project into a .jar executable, create a &#039;&#039;&#039;manifest.mf&#039;&#039;&#039; file with the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Manifest-Version: 1.0&lt;br /&gt;
Main-Class: example&lt;br /&gt;
Class-Path: phidget22.jar&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Make sure there&#039;s an empty newline at the bottom of the three lines and a space after each colon.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Next, create the .jar file with this command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
jar cfm example.jar manifest.mf *.class&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once the .jar is created, you can execute it with&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Netbeans===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
| To start, open NetBeans and create a new project. Select Java Application and follow the steps as directed by Netbeans.|| [[Image:Windows_netbeans1.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/c/c9/Windows_netbeans1.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, add a reference to phidget22.jar by right-clicking on the libraries folder. || [[Image:Windows_netbeans2.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/2/2b/Windows_netbeans2.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Navigate to the folder where you downloaded phidget22.jar, and select it. || [[Image:Windows_netbeans3.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/7/76/Windows_netbeans3.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| The project now has access to Phidgets. By default, Netbeans should create an executable .jar file in the &#039;&#039;&#039;dist&#039;&#039;&#039; folder of the project directory when it&#039;s built. If it didn&#039;t, go to &#039;&#039;&#039;Build -&amp;gt; Packaging&#039;&#039;&#039; in the project properties and make sure &amp;quot;Build JAR after compiling&amp;quot; is checked.|| [[Image:Windows_netbeans4.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/78/Windows_netbeans4.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Eclipse===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start, open Eclipse and create a new Java project. Name the project and uncheck the &#039;&#039;&#039;create module-info.java file&#039;&#039;&#039; box.|| [[Image:java_eclipse_newproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/97/Java_eclipse_newproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| On the Libraries tab, click Add External JARs and add [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip phidget22.jar].  to your project as an external jar. Be sure it&#039;s being added to the &#039;&#039;&#039;Classpath&#039;&#039;&#039; and not the module path. || [[Image:java_eclipse_library.png|center|350px|link=https://cdn.phidgets.com/docs/images/1/1b/Java_eclipse_library.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Create a new Class in your project. || [[Image:java_eclipse_newclass.png|center|350px|link=https://cdn.phidgets.com/docs/images/0/02/Java_eclipse_newclass.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Name the class, and be sure to check the &#039;&#039;&#039;public static void main&#039;&#039;&#039; box. Eclipse may require that you add a package name. || [[Image:java_eclipse_newclass2.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/ca/Java_eclipse_newclass2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Your project now has access to Phidgets! ||&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, right click on the project in the package explorer and choose &#039;&#039;&#039;Export&#039;&#039;&#039;. Select &#039;&#039;&#039;Runnable JAR file&#039;&#039;&#039;. || [[Image:java_eclipse_export.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8c/Java_eclipse_export.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Choose the main class and a destination for the .jar file and click finish. || [[Image:java_eclipse_export2.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8d/Java_eclipse_export2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PhidgetSBC Web Interface ===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;center&amp;gt;{{#ev:youtube|gZmWvWXICIA|rel=0}}&amp;lt;/center&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=Java Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_java_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/a/af/Language_java_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
== Deploying Applications ==&lt;br /&gt;
The following files are required for your Java application:&lt;br /&gt;
* phidget22.jar &lt;br /&gt;
* phidget22.dll&lt;br /&gt;
* phidget22java.dll&lt;br /&gt;
&lt;br /&gt;
The files can be found in the [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Development Files]. The .jar file is in lib/java, and the dll files are in lib/c/x64. &lt;br /&gt;
&lt;br /&gt;
Java will look for these files in several locations, including the classpath and the working folder of the project.&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=Python Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35585</id>
		<title>Language - Java</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35585"/>
		<updated>2026-04-02T16:38:13Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Java Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with Java.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22 library, it&#039;s easy to create Java applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==Java Libraries==&lt;br /&gt;
During development, we recommend downloading the appropriate installer or package for your [https://www.phidgets.com/docs/Operating_System_Support operating system]. This will place the required Phidget library files in standard locations where Java will look for them. When [[#Deploying Applications|deploying applications]], you can instead include these files manually as part of your application. &lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_Udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
&lt;br /&gt;
Before choosing a development environment, make sure you have the [http://www.oracle.com/technetwork/java/index.html Java Development Kit] installed. &lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start developing with Java in VSCode, open it up and install the &#039;&#039;&#039;Extension Pack for Java&#039;&#039;&#039;.||[[Image:Language_java_vscode_extension2.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b4/Language_java_vscode_extension2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, press &#039;&#039;&#039;Ctrl+Shift+P&#039;&#039;&#039; to open the command palette, type &amp;quot;java&amp;quot; and select &#039;&#039;&#039;Java: Create Java Project&#039;&#039;&#039;.  || [[Image:Language_java_vscode_createproj.png|center|360px|link=https://cdn.phidgets.com/docs/images/7/78/Language_java_vscode_createproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Select &amp;quot;No Build Tools&amp;quot; and select a directory for the new project. You&#039;ll be asked for a project name, and  VSCode will create the directory structure. || [[Image:Language_java_vscode_emptyproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/c1/Language_java_vscode_emptyproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|You&#039;ll need to get a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; to put inside the &amp;quot;lib&amp;quot; folder. [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here]. &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now begin writing code in the newly created &amp;quot;App.java&amp;quot; file, or you can download a [[#Example_Code|sample program]] for your device and place it in the &amp;quot;src&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| Compile and run by pressing &#039;&#039;&#039;F5&#039;&#039;&#039; or by clicking the play button in the top right. || [[Image:Language_java_vscode_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/e/ea/Language_java_vscode_run.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, click on the &#039;&#039;&#039;Java Projects&#039;&#039;&#039; section in the explorer. || [[Image:Language_java_vscode_jar.png|center|350px|link=https://cdn.phidgets.com/docs/images/6/65/Language_java_vscode_jar.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Click on the export icon, and then select your main class and click OK. || [[Image:Language_java_vscode_jar2.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/74/Language_java_vscode_jar2.png]]&lt;br /&gt;
|- &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Now you can run your new .jar file with the following command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar Example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Javac===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|To run your program, enter the following command in the command prompt or terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
javac -classpath .;phidget22.jar example.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, enter the following command to run the program:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -classpath .;phidget22.jar example &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Once you&#039;re ready to compile your project into a .jar executable, create a &#039;&#039;&#039;manifest.mf&#039;&#039;&#039; file with the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Manifest-Version: 1.0&lt;br /&gt;
Main-Class: example&lt;br /&gt;
Class-Path: phidget22.jar&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Make sure there&#039;s an empty newline at the bottom of the three lines and a space after each colon.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Next, create the .jar file with this command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
jar cfm example.jar manifest.mf *.class&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once the .jar is created, you can execute it with&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Netbeans===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
| To start, open NetBeans and create a new project. Select Java Application and follow the steps as directed by Netbeans.|| [[Image:Windows_netbeans1.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/c/c9/Windows_netbeans1.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, add a reference to phidget22.jar by right-clicking on the libraries folder. || [[Image:Windows_netbeans2.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/2/2b/Windows_netbeans2.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Navigate to the folder where you downloaded phidget22.jar, and select it. || [[Image:Windows_netbeans3.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/7/76/Windows_netbeans3.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| The project now has access to Phidgets. By default, Netbeans should create an executable .jar file in the &#039;&#039;&#039;dist&#039;&#039;&#039; folder of the project directory when it&#039;s built. If it didn&#039;t, go to &#039;&#039;&#039;Build -&amp;gt; Packaging&#039;&#039;&#039; in the project properties and make sure &amp;quot;Build JAR after compiling&amp;quot; is checked.|| [[Image:Windows_netbeans4.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/78/Windows_netbeans4.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Eclipse===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start, open Eclipse and create a new Java project. Name the project and uncheck the &#039;&#039;&#039;create module-info.java file&#039;&#039;&#039; box.|| [[Image:java_eclipse_newproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/97/Java_eclipse_newproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| On the Libraries tab, click Add External JARs and add [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip phidget22.jar].  to your project as an external jar. Be sure it&#039;s being added to the &#039;&#039;&#039;Classpath&#039;&#039;&#039; and not the module path. || [[Image:java_eclipse_library.png|center|350px|link=https://cdn.phidgets.com/docs/images/1/1b/Java_eclipse_library.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Create a new Class in your project. || [[Image:java_eclipse_newclass.png|center|350px|link=https://cdn.phidgets.com/docs/images/0/02/Java_eclipse_newclass.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Name the class, and be sure to check the &#039;&#039;&#039;public static void main&#039;&#039;&#039; box. Eclipse may require that you add a package name. || [[Image:java_eclipse_newclass2.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/ca/Java_eclipse_newclass2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Your project now has access to Phidgets! ||&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, right click on the project in the package explorer and choose &#039;&#039;&#039;Export&#039;&#039;&#039;. Select &#039;&#039;&#039;Runnable JAR file&#039;&#039;&#039;. || [[Image:java_eclipse_export.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8c/Java_eclipse_export.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Choose the main class and a destination for the .jar file and click finish. || [[Image:java_eclipse_export2.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8d/Java_eclipse_export2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PhidgetSBC Web Interface ===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;center&amp;gt;{{#ev:youtube|gZmWvWXICIA|rel=0}}&amp;lt;/center&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=Java Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_java_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/a/af/Language_java_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
== Deploying Applications ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re planning to deploy your application, it should be noted that you don&#039;t strictly need the Phidget Drivers installed. &lt;br /&gt;
&lt;br /&gt;
At a minimum, these three files are required:&lt;br /&gt;
* phidget22.jar &lt;br /&gt;
* phidget22.dll&lt;br /&gt;
* phidget22java.dll&lt;br /&gt;
&lt;br /&gt;
All three files can be found in the [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Development Files]. The .jar file is in lib/java, and the .dll files are in lib/c/x64. &lt;br /&gt;
&lt;br /&gt;
Java will look for these files in several locations, including the classpath and the working folder of the project.&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=Python Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35584</id>
		<title>Language - Java</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35584"/>
		<updated>2026-04-02T16:37:19Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Java Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with Java.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22 library, it&#039;s easy to create Java applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==Java Libraries==&lt;br /&gt;
During development, we recommend downloading the appropriate installer or package for your [https://www.phidgets.com/docs/Operating_System_Support operating system]. This will put required Phidget library files in standard locations where Java will look for them. When [[#Deploying Applications|deploying applications]], you can manually include these files yourself as part of your application. &lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_Udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
&lt;br /&gt;
Before choosing a development environment, make sure you have the [http://www.oracle.com/technetwork/java/index.html Java Development Kit] installed. &lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start developing with Java in VSCode, open it up and install the &#039;&#039;&#039;Extension Pack for Java&#039;&#039;&#039;.||[[Image:Language_java_vscode_extension2.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b4/Language_java_vscode_extension2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, press &#039;&#039;&#039;Ctrl+Shift+P&#039;&#039;&#039; to open the command palette, type &amp;quot;java&amp;quot; and select &#039;&#039;&#039;Java: Create Java Project&#039;&#039;&#039;.  || [[Image:Language_java_vscode_createproj.png|center|360px|link=https://cdn.phidgets.com/docs/images/7/78/Language_java_vscode_createproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Select &amp;quot;No Build Tools&amp;quot; and select a directory for the new project. You&#039;ll be asked for a project name, and  VSCode will create the directory structure. || [[Image:Language_java_vscode_emptyproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/c1/Language_java_vscode_emptyproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|You&#039;ll need to get a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; to put inside the &amp;quot;lib&amp;quot; folder. [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here]. &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now begin writing code in the newly created &amp;quot;App.java&amp;quot; file, or you can download a [[#Example_Code|sample program]] for your device and place it in the &amp;quot;src&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| Compile and run by pressing &#039;&#039;&#039;F5&#039;&#039;&#039; or by clicking the play button in the top right. || [[Image:Language_java_vscode_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/e/ea/Language_java_vscode_run.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, click on the &#039;&#039;&#039;Java Projects&#039;&#039;&#039; section in the explorer. || [[Image:Language_java_vscode_jar.png|center|350px|link=https://cdn.phidgets.com/docs/images/6/65/Language_java_vscode_jar.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Click on the export icon, and then select your main class and click OK. || [[Image:Language_java_vscode_jar2.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/74/Language_java_vscode_jar2.png]]&lt;br /&gt;
|- &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Now you can run your new .jar file with the following command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar Example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Javac===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|To run your program, enter the following command in the command prompt or terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
javac -classpath .;phidget22.jar example.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, enter the following command to run the program:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -classpath .;phidget22.jar example &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Once you&#039;re ready to compile your project into a .jar executable, create a &#039;&#039;&#039;manifest.mf&#039;&#039;&#039; file with the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Manifest-Version: 1.0&lt;br /&gt;
Main-Class: example&lt;br /&gt;
Class-Path: phidget22.jar&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Make sure there&#039;s an empty newline at the bottom of the three lines and a space after each colon.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Next, create the .jar file with this command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
jar cfm example.jar manifest.mf *.class&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once the .jar is created, you can execute it with&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Netbeans===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
| To start, open NetBeans and create a new project. Select Java Application and follow the steps as directed by Netbeans.|| [[Image:Windows_netbeans1.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/c/c9/Windows_netbeans1.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, add a reference to phidget22.jar by right-clicking on the libraries folder. || [[Image:Windows_netbeans2.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/2/2b/Windows_netbeans2.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Navigate to the folder where you downloaded phidget22.jar, and select it. || [[Image:Windows_netbeans3.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/7/76/Windows_netbeans3.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| The project now has access to Phidgets. By default, Netbeans should create an executable .jar file in the &#039;&#039;&#039;dist&#039;&#039;&#039; folder of the project directory when it&#039;s built. If it didn&#039;t, go to &#039;&#039;&#039;Build -&amp;gt; Packaging&#039;&#039;&#039; in the project properties and make sure &amp;quot;Build JAR after compiling&amp;quot; is checked.|| [[Image:Windows_netbeans4.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/78/Windows_netbeans4.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Eclipse===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start, open Eclipse and create a new Java project. Name the project and uncheck the &#039;&#039;&#039;create module-info.java file&#039;&#039;&#039; box.|| [[Image:java_eclipse_newproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/97/Java_eclipse_newproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| On the Libraries tab, click Add External JARs and add [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip phidget22.jar].  to your project as an external jar. Be sure it&#039;s being added to the &#039;&#039;&#039;Classpath&#039;&#039;&#039; and not the module path. || [[Image:java_eclipse_library.png|center|350px|link=https://cdn.phidgets.com/docs/images/1/1b/Java_eclipse_library.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Create a new Class in your project. || [[Image:java_eclipse_newclass.png|center|350px|link=https://cdn.phidgets.com/docs/images/0/02/Java_eclipse_newclass.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Name the class, and be sure to check the &#039;&#039;&#039;public static void main&#039;&#039;&#039; box. Eclipse may require that you add a package name. || [[Image:java_eclipse_newclass2.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/ca/Java_eclipse_newclass2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Your project now has access to Phidgets! ||&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, right click on the project in the package explorer and choose &#039;&#039;&#039;Export&#039;&#039;&#039;. Select &#039;&#039;&#039;Runnable JAR file&#039;&#039;&#039;. || [[Image:java_eclipse_export.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8c/Java_eclipse_export.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Choose the main class and a destination for the .jar file and click finish. || [[Image:java_eclipse_export2.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8d/Java_eclipse_export2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PhidgetSBC Web Interface ===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;center&amp;gt;{{#ev:youtube|gZmWvWXICIA|rel=0}}&amp;lt;/center&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=Java Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_java_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/a/af/Language_java_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
== Deploying Applications ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re planning to deploy your application, it should be noted that you don&#039;t strictly need the Phidget Drivers installed. &lt;br /&gt;
&lt;br /&gt;
At a minimum, these three files are required:&lt;br /&gt;
* phidget22.jar &lt;br /&gt;
* phidget22.dll&lt;br /&gt;
* phidget22java.dll&lt;br /&gt;
&lt;br /&gt;
All three files can be found in the [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Development Files]. The .jar file is in lib/java, and the .dll files are in lib/c/x64. &lt;br /&gt;
&lt;br /&gt;
Java will look for these files in several locations, including the classpath and the working folder of the project.&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=Python Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35583</id>
		<title>Language - Java</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Java&amp;diff=35583"/>
		<updated>2026-04-02T16:11:15Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with Java.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22 library, it&#039;s easy to create Java applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==Java Libraries==&lt;br /&gt;
&lt;br /&gt;
We recommend installing the [https://www.phidgets.com/docs/Operating_System_Support Phidget drivers] for your operating system. Installing the drivers will put required .dll files in the proper place where Java will look for them. If you want to run your application on a computer without installing our drivers, see the [[#Deploying Applications|Deploying Applications]] section.&lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_Udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
&lt;br /&gt;
Before choosing a development environment, make sure you have the [http://www.oracle.com/technetwork/java/index.html Java Development Kit] installed. &lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start developing with Java in VSCode, open it up and install the &#039;&#039;&#039;Extension Pack for Java&#039;&#039;&#039;.||[[Image:Language_java_vscode_extension2.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b4/Language_java_vscode_extension2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, press &#039;&#039;&#039;Ctrl+Shift+P&#039;&#039;&#039; to open the command palette, type &amp;quot;java&amp;quot; and select &#039;&#039;&#039;Java: Create Java Project&#039;&#039;&#039;.  || [[Image:Language_java_vscode_createproj.png|center|360px|link=https://cdn.phidgets.com/docs/images/7/78/Language_java_vscode_createproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Select &amp;quot;No Build Tools&amp;quot; and select a directory for the new project. You&#039;ll be asked for a project name, and  VSCode will create the directory structure. || [[Image:Language_java_vscode_emptyproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/c1/Language_java_vscode_emptyproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|You&#039;ll need to get a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; to put inside the &amp;quot;lib&amp;quot; folder. [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here]. &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now begin writing code in the newly created &amp;quot;App.java&amp;quot; file, or you can download a [[#Example_Code|sample program]] for your device and place it in the &amp;quot;src&amp;quot; folder.&lt;br /&gt;
|-&lt;br /&gt;
| Compile and run by pressing &#039;&#039;&#039;F5&#039;&#039;&#039; or by clicking the play button in the top right. || [[Image:Language_java_vscode_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/e/ea/Language_java_vscode_run.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, click on the &#039;&#039;&#039;Java Projects&#039;&#039;&#039; section in the explorer. || [[Image:Language_java_vscode_jar.png|center|350px|link=https://cdn.phidgets.com/docs/images/6/65/Language_java_vscode_jar.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Click on the export icon, and then select your main class and click OK. || [[Image:Language_java_vscode_jar2.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/74/Language_java_vscode_jar2.png]]&lt;br /&gt;
|- &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Now you can run your new .jar file with the following command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar Example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Javac===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot;|To run your program, enter the following command in the command prompt or terminal:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
javac -classpath .;phidget22.jar example.java&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then, enter the following command to run the program:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -classpath .;phidget22.jar example &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|| &lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Once you&#039;re ready to compile your project into a .jar executable, create a &#039;&#039;&#039;manifest.mf&#039;&#039;&#039; file with the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Manifest-Version: 1.0&lt;br /&gt;
Main-Class: example&lt;br /&gt;
Class-Path: phidget22.jar&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Make sure there&#039;s an empty newline at the bottom of the three lines and a space after each colon.&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| Next, create the .jar file with this command:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
jar cfm example.jar manifest.mf *.class&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once the .jar is created, you can execute it with&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar example.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Netbeans===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|The easiest way to allow Java to access the Phidgets Java library is to place a copy of &#039;&#039;&#039;phidget22.jar&#039;&#039;&#039; in the same folder as your .java program.  ||[[Image:Language_java_javac_folder.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/89/Language_java_javac_folder.png]]&lt;br /&gt;
|-&lt;br /&gt;
|[https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip You can download phidget22.jar here].|| &lt;br /&gt;
|-&lt;br /&gt;
| To start, open NetBeans and create a new project. Select Java Application and follow the steps as directed by Netbeans.|| [[Image:Windows_netbeans1.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/c/c9/Windows_netbeans1.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, add a reference to phidget22.jar by right-clicking on the libraries folder. || [[Image:Windows_netbeans2.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/2/2b/Windows_netbeans2.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Navigate to the folder where you downloaded phidget22.jar, and select it. || [[Image:Windows_netbeans3.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/7/76/Windows_netbeans3.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| The project now has access to Phidgets. By default, Netbeans should create an executable .jar file in the &#039;&#039;&#039;dist&#039;&#039;&#039; folder of the project directory when it&#039;s built. If it didn&#039;t, go to &#039;&#039;&#039;Build -&amp;gt; Packaging&#039;&#039;&#039; in the project properties and make sure &amp;quot;Build JAR after compiling&amp;quot; is checked.|| [[Image:Windows_netbeans4.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/78/Windows_netbeans4.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Eclipse===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| To start, open Eclipse and create a new Java project. Name the project and uncheck the &#039;&#039;&#039;create module-info.java file&#039;&#039;&#039; box.|| [[Image:java_eclipse_newproj.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/97/Java_eclipse_newproj.png]]&lt;br /&gt;
|-&lt;br /&gt;
| On the Libraries tab, click Add External JARs and add [https://www.phidgets.com/downloads/phidget22/libraries/any/Phidget22Java.zip phidget22.jar].  to your project as an external jar. Be sure it&#039;s being added to the &#039;&#039;&#039;Classpath&#039;&#039;&#039; and not the module path. || [[Image:java_eclipse_library.png|center|350px|link=https://cdn.phidgets.com/docs/images/1/1b/Java_eclipse_library.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Create a new Class in your project. || [[Image:java_eclipse_newclass.png|center|350px|link=https://cdn.phidgets.com/docs/images/0/02/Java_eclipse_newclass.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Name the class, and be sure to check the &#039;&#039;&#039;public static void main&#039;&#039;&#039; box. Eclipse may require that you add a package name. || [[Image:java_eclipse_newclass2.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/ca/Java_eclipse_newclass2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Your project now has access to Phidgets! ||&lt;br /&gt;
|-&lt;br /&gt;
| Once you&#039;re ready to compile your project into a .jar executable, right click on the project in the package explorer and choose &#039;&#039;&#039;Export&#039;&#039;&#039;. Select &#039;&#039;&#039;Runnable JAR file&#039;&#039;&#039;. || [[Image:java_eclipse_export.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8c/Java_eclipse_export.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Choose the main class and a destination for the .jar file and click finish. || [[Image:java_eclipse_export2.png|center|350px|link=https://cdn.phidgets.com/docs/images/8/8d/Java_eclipse_export2.png]]&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;| You can now run the .jar file from the command prompt with:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
java -jar phidgetTest.jar&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PhidgetSBC Web Interface ===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;center&amp;gt;{{#ev:youtube|gZmWvWXICIA|rel=0}}&amp;lt;/center&amp;gt; &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=Java Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_java_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/a/af/Language_java_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
== Deploying Applications ==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re planning to deploy your application, it should be noted that you don&#039;t strictly need the Phidget Drivers installed. &lt;br /&gt;
&lt;br /&gt;
At a minimum, these three files are required:&lt;br /&gt;
* phidget22.jar &lt;br /&gt;
* phidget22.dll&lt;br /&gt;
* phidget22java.dll&lt;br /&gt;
&lt;br /&gt;
All three files can be found in the [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Development Files]. The .jar file is in lib/java, and the .dll files are in lib/c/x64. &lt;br /&gt;
&lt;br /&gt;
Java will look for these files in several locations, including the classpath and the working folder of the project.&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=Python Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35475</id>
		<title>Terms and Conditions</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Terms_and_Conditions&amp;diff=35475"/>
		<updated>2026-03-13T01:39:25Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Holidays */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Linked From Website]]&lt;br /&gt;
&lt;br /&gt;
==Product Warranty==&lt;br /&gt;
&lt;br /&gt;
All Phidgets products are warranted to be free of defects in material or workmanship under normal use and service for a period of one year from the date of shipment. This warranty does not include damage resulting from accident or misuse. The warranty is also void if the product is modified.  This warranty is in lieu of all other warranties expressed or implied including the implied warranties of merchantability of fitness for a particular purpose, whether arising by law, custom or conduct, and the rights and remedies provided under this warranty are exclusive and in lieu of any other rights or remedies. In no event shall Phidgets Incorporated be liable for consequential damages.&lt;br /&gt;
&lt;br /&gt;
If you believe that your product is defective while still under warranty, {{ContactUs|contact us}}. Once the support desk confirms that the product is defective, we will replace your defective product free of charge.&lt;br /&gt;
&lt;br /&gt;
==Shipping==&lt;br /&gt;
===Last Call at 12:00PM===&lt;br /&gt;
Orders received before 12:00 PM Mountain Time (GMT-07:00) Monday to Friday will be shipped the same day.&lt;br /&gt;
&lt;br /&gt;
Orders containing cut-to-length parts may not ship on the same day due to the additional processing time associated with these orders.&lt;br /&gt;
&lt;br /&gt;
===Shipping Costs===&lt;br /&gt;
Shipping costs are calculated at checkout and presented for your review before you confirm your order. If multiple shipping options are available for your destination, all options will be listed so you can choose the one that best suits your needs.&lt;br /&gt;
&lt;br /&gt;
If you have your own UPS or FedEx account, you can use it at checkout and be billed directly by the carrier. This gives you access to a wider range of shipping options.&lt;br /&gt;
&lt;br /&gt;
Note that a $5.00 handling charge is added to all orders that are under $50.00.&lt;br /&gt;
&lt;br /&gt;
===Shipping in Canada===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
===Shipping to the United States===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
* &#039;&#039;&#039;UPS Standard&#039;&#039;&#039;. 3 - 5 business days ground delivery.&lt;br /&gt;
&lt;br /&gt;
Effective May 2, 2025, orders shipped to the United States will incur additional duties, tariffs, and brokerage fees, regardless of the order value. For more details, visit our guide about [[U.S._Tariffs | U.S. Tariffs]].&lt;br /&gt;
&lt;br /&gt;
===International Shipments===&lt;br /&gt;
We offer the following services:&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Express Saver&#039;&#039;&#039;. 1 - 3 business days.&lt;br /&gt;
* &#039;&#039;&#039;UPS Worldwide Expedited&#039;&#039;&#039;. 2 - 5 business days. Available for packages over 3 lbs. &lt;br /&gt;
&lt;br /&gt;
====European Union====&lt;br /&gt;
Effective July 1, 2021, the European Union (EU) updated its Value Added Tax (VAT) regulations. All shipments to EU countries now require formal customs clearance and are subject to VAT based on the destination country.&lt;br /&gt;
&lt;br /&gt;
For goods with an intrinsic value up to €150, VAT must be collected at the time of purchase. This means for orders under $200 USD, we require prepayment of VAT and brokerage fees at checkout to ensure fast, hassle-free delivery.&lt;br /&gt;
&lt;br /&gt;
For orders over $200 USD, we provide the option to prepay all applicable import fees (including VAT and brokerage). If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
====Other Countries====&lt;br /&gt;
International shipments may be subject to import duties, taxes, and brokerage fees upon arrival in your country. These charges are determined by your local customs authorities and are the responsibility of the recipient.&lt;br /&gt;
&lt;br /&gt;
At checkout, we provide the option to prepay these fees. If you choose this option, the quoted amount is guaranteed — there will be no additional charges upon delivery.&lt;br /&gt;
&lt;br /&gt;
We use UPS® Global Checkout to collect import fees and taxes based on your product&#039;s HS Code and Country of Origin. There is a fee associated with the UPS® Global Checkout service. At Phidgets Inc., we continually monitor and negotiate all fees to ensure our customers receive the best deal possible.&lt;br /&gt;
&lt;br /&gt;
Customs policies vary by country, so we recommend contacting your local customs office for more information.&lt;br /&gt;
&lt;br /&gt;
===Tracking Your Order===&lt;br /&gt;
You can track your shipment using the tracking number sent to you by email when your order was shipped.&lt;br /&gt;
&lt;br /&gt;
===Refunds on Late Deliveries===&lt;br /&gt;
&lt;br /&gt;
Normally, UPS will offer a service guarantee refund when their deliveries arrive late. However, for companies that apply for shipping discounts, this refund does not apply. Phidgets Inc. has applied for such discounts in order to keep shipping costs down and regrettably cannot offer compensation for late shipments.&lt;br /&gt;
&lt;br /&gt;
===Damaged or Lost Shipment===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on our UPS account&#039;&#039;&#039; - Report all damaged or lost shipments to support@phidgets.com and include your order number. According to UPS, in order to be considered lost, a package must be undelivered 24 hours after the expected delivery date and time. Before contacting us, check your shipment status at ups.ca.&lt;br /&gt;
&lt;br /&gt;
Damaged or lost items will be replaced at no charge (including shipping costs).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Shipping on your UPS account&#039;&#039;&#039; - You must notify your local UPS office. If they confirm that they have lost your shipment, you must repurchase the lost or damaged products from Phidgets and file a claim with your local UPS in order to get reimbursed.&lt;br /&gt;
&lt;br /&gt;
===Refused/Missed Delivery===&lt;br /&gt;
If no one is available to accept the package upon delivery, UPS will attempt redelivery two more times, as per their standard procedure. If all delivery attempts fail, UPS will hold the package for 5 days before returning it to us. In such cases, we will issue a refund for your order minus the cost of shipping (both directions) and a flat $50 fee, up to the total value of the package. This policy applies both to deliveries that failed due to no one being present and to packages that were refused at the delivery address.&lt;br /&gt;
&lt;br /&gt;
===Incoterms===&lt;br /&gt;
&lt;br /&gt;
We use the following Incoterms depending on the shipping and payment arrangement:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FCA (Free Carrier):&#039;&#039;&#039; Used when shipping on the customer’s carrier account. Risk and responsibility transfer to the customer once the goods are handed over to the carrier at our facility.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DDP (Delivered Duty Paid):&#039;&#039;&#039; Used when the customer chooses to pre-pay import fees and taxes at checkout. We handle all import fees and deliver the goods to the destination address.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;DAP (Delivered at Place):&#039;&#039;&#039; Used when the customer opts to pay import fees and taxes upon delivery. We deliver the goods, but the customer is responsible for paying any import fees directly to the carrier.&lt;br /&gt;
&lt;br /&gt;
==Product Returns==&lt;br /&gt;
===All Returns Must Be Authorized===&lt;br /&gt;
Before returning a package {{ContactUs|contact us}} and ask for a Return Merchandise Authorization or RMA number.  Once you have received it, put the RMA number on the outside of the packaging as well as the packing slip so that it is possible for us to track what the package is supposed to be.  Any merchandise returned without an RMA number clearly visible on the packaging will be charged an administrative fee of $25.00 or the value of the returned product, whichever is less &#039;&#039;if we are able to determine what it is&#039;&#039;.  In the event we are unable to determine what the package is, it will be refused and returned to the sender.&lt;br /&gt;
&lt;br /&gt;
===Unopened Product===&lt;br /&gt;
Phidgets accepts returns of unopened products within 30 days of the date of purchase. To initiate a return, please contact us by phone or email to obtain an RMA number. Products must be shipped back to Phidgets Inc. prepaid. A refund will be issued to your credit card once we receive and inspect the returned items.  The refund excludes the cost of shipping as well as any duties or brokerage charges incurred.  &lt;br /&gt;
&lt;br /&gt;
Returns received after 30 days are subject to a restocking fee of 25% of the package&#039;s value (minimum $5.00, maximum $500).&lt;br /&gt;
&lt;br /&gt;
We do &#039;&#039;&#039;not&#039;&#039;&#039; accept returns beyond 90 days from the date of purchase.&lt;br /&gt;
&lt;br /&gt;
===Cut to Length===&lt;br /&gt;
Unfortunately we cannot accept returns on any items which are cut to custom lengths.  This includes: cable, wire, roller chain, linear shaft, rotary shaft, and t-slot extrusions.  &lt;br /&gt;
&lt;br /&gt;
===We Shipped the Wrong/Incomplete Product===&lt;br /&gt;
{{ContactUs|Contact us}}. We will get the correct product sent to you immediately, and will pay all shipping charges.&lt;br /&gt;
&lt;br /&gt;
==Payment Terms==&lt;br /&gt;
We accept credit cards, PayPal, and Wire Transfers.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! Payment Method|| Terms&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Credit Cards&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Visa, MasterCard, American Express (for order in CAD only)&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|PayPal&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|PayPal is accepted.  There are no extra fees for using PayPal&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center|Wire Transfers&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=left|Wire transfers are only accepted for orders over $200.00 USD (excluding shipping charges). There is a $25.00 USD charge for wire transfers under $500.00 USD. Any fees charged by the sending bank are your responsibility.&amp;lt;br /&amp;gt;Please make sure that the amount sent to us covers both our invoice and your bank fees.  Products are not shipped until the money is deposited in our bank account.  We recommend that you e-mail orders@phidgets.com with the amount of the transfer and the invoice you are paying.  &amp;lt;br /&amp;gt;Any order for which payment is not received within 15 days, will be canceled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Security and Privacy==&lt;br /&gt;
Phidgets Inc. pledges a safe and worry-free shopping experience. IF you are using the current version of Internet Explorer, on the checkout page where you enter your credit card information, you will notice a a locked padlock icon on the top bar your browser window. If you are using Mozilla Firefox, you will notice a locked padlock icon in the bottom right corner of your browser window. If this icon does not appear, please contact us directly to complete your purchase. These icons tell you that the page you are on is secure. We use Secure Sockets Layer (SSL 128-bit) technology with a digital certificate by GeoTrust, Inc. for Internet security to protect your personal information. This encryption makes it impossible for anyone to read your information in transit. We do not store your credit information and it is deleted once it has been securely transmitted to Moneris for processing.&lt;br /&gt;
&lt;br /&gt;
We use your e-mail address to let you know your shipment&#039;s tracking number. Your phone number is required by the Courier Company. We do not sell, rent or give any of your personal information to any unrelated third parties with the exception of Moneris for authorizing credit card payments and the Courier company to let them know where to deliver the shipment and how to contact you if there is any problems.&lt;br /&gt;
&lt;br /&gt;
If you have any questions or concerns about our Security and Privacy policy, call us at 1.403.282.7335 or e-mail us at support@phidgets.com&lt;br /&gt;
&lt;br /&gt;
Phidgets Inc. uses various Google Analytics tools such as conversion tracking in order to improve the effectiveness of the website. These statistics are completely anonymous.&lt;br /&gt;
&lt;br /&gt;
==Holidays==&lt;br /&gt;
Phidgets, Inc. will be closed on the following days. During these times, the site will still be accessible and orders can be placed, but they will not ship until the next business day.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border:1px solid darkgray;&amp;quot; cellpadding=&amp;quot;7px;&amp;quot;&lt;br /&gt;
|-style=&amp;quot;background: #d1d1d1&amp;quot; align=center &lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Holiday&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2026&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| 2027&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Alberta Family Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Third Monday in February&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 16&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Feb 15&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Good Friday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Friday before Easter Sunday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Apr 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Mar 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Victoria Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Monday before May 25&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 18&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| May 24&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Canada Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First day of July (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Jul 1&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Civic Holiday&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in August&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 3&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Aug 2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Labour Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| First Monday in September&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 7&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Sept 6&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Thanksgiving&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Second Monday in October&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 12&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Oct 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Remembrance Day&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| November 11 (or nearest business day)&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Nov 11&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Christmas and New Years&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| Varies&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|style=&amp;quot;background: #f0f0f0&amp;quot; align=center| TBA&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_C_Sharp&amp;diff=35443</id>
		<title>Language - C Sharp</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_C_Sharp&amp;diff=35443"/>
		<updated>2026-03-06T17:00:43Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* macOS Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with C#.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22.NET library, it&#039;s easy to create C# applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==C# Libraries==&lt;br /&gt;
===Nuget Package===&lt;br /&gt;
The Phidget22.NET library is available as a [https://www.nuget.org/packages/Phidget22.NET/ nuget package]. This is the recommend way to install and manage the Phidget22.NET library.&lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your .NET application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
===Library Files===&lt;br /&gt;
If you would like to manually manage the Phidget22.NET library files, you can download them [https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip here].&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
===Visual Studio===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| Create your Visual Studio project, and navigate to the &#039;&#039;&#039;Solution Explorer&#039;&#039;&#039;. From there, right-click on &#039;&#039;&#039;Dependencies&#039;&#039;&#039; and select &#039;&#039;&#039;Manage NuGet Packages...&#039;&#039;&#039;|| [[Image:Language_csharp_vs_managenuget.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/cc/Language_csharp_vs_managenuget.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, click &#039;&#039;&#039;Browse&#039;&#039;&#039; and enter &#039;&#039;&#039;Phidget22.NET&#039;&#039;&#039; in the search bar. || [[Image:Language_csharp_vs_browsenuget.png|center|350px|link=https://cdn.phidgets.com/docs/images/6/61/Language_csharp_vs_browsenuget.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Click on the package and press the &#039;&#039;&#039;Install&#039;&#039;&#039; button. || [[Image:Language_csharp_vs_installnuget.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b8/Language_csharp_vs_installnuget.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Finally, add your C# code and run it using the button at the top of the screen. || [[Image:Language_csharp_vs_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/5/5a/Language_csharp_vs_run.png]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| Install the [https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit C# Dev Kit extension for Visual Studio Code].|| [[Image:Language_csharp_vscode_installext.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/b8/Language_csharp_vscode_installext.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, create a directory and open it in Visual Studio Code. You can do this by opening Visual Studio Code and selecting &#039;&#039;&#039;File &amp;gt; Open Folder...&#039;&#039;&#039; || [[Image:Language_csharp_vscode_newfolder.png|center|350px|link=https://cdn.phidgets.com/docs/images/4/43/Language_csharp_vscode_newfolder.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Open the Command Palette (Ctrl + Shift + P), type &#039;&#039;&#039;.NET: New Project&#039;&#039;&#039;, and press Enter. A list of supported project types will appear. || [[Image:Language_csharp_vscode_netnewproject.png|center|350px|link=https://cdn.phidgets.com/docs/images/f/f7/Language_csharp_vscode_netnewproject.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Select your preferred project type from the list. For this example, we will select &#039;&#039;&#039;Console App&#039;&#039;&#039;. || [[Image:Language_csharp_vscode_netconsoleapp.png|center|350px|link=https://cdn.phidgets.com/docs/images/b/bc/Language_csharp_vscode_netconsoleapp.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, we need to add the Phidget22.NET library using NuGet. Open the Command Palette again (Ctrl + Shift + P), and enter &#039;&#039;&#039;NuGet: Add NuGet package...&#039;&#039;&#039;. &lt;br /&gt;
 || [[Image:Language_csharp_vscode_addnugetpackage.png|center|350px|link=https://cdn.phidgets.com/docs/images/2/26/Language_csharp_vscode_addnugetpackage.png]]&lt;br /&gt;
|-&lt;br /&gt;
| When prompted, enter &#039;&#039;&#039;Phidget22.NET&#039;&#039;&#039; and install the latest package.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039;: Ensure you are downloading the latest version which can be seen [{{SERVER}}/?view=changelog here]. Visual Studio Code may incorrectly show an older version as the &#039;&#039;latest&#039;&#039; by default.|| [[Image:Language_csharp_vscode_phidget22net.png|center|350px|link=https://cdn.phidgets.com/docs/images/d/d5/Language_csharp_vscode_phidget22net.png]]&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Finally, add your C# code and run it using the button at the top of the screen. || [[Image:Language_csharp_vscode_runcodepng.png|center|350px|link=https://cdn.phidgets.com/docs/images/d/dc/Language_csharp_vscode_runcodepng.png]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===.NET Command-Line Interface (CLI)===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| Download and install the latest version of.NET from [https://dotnet.microsoft.com/en-us/download/dotnet Microsoft&#039;s .NET download page].|| [[Image:Language_csharp_cli_download.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/90/Language_csharp_cli_download.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, open a command prompt or terminal in a new folder and enter the following command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dotnet new console&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|| [[Image:Language_csharp_cli_newconsole.png|center|350px|link=https://cdn.phidgets.com/docs/images/3/3a/Language_csharp_cli_newconsole.png]]&lt;br /&gt;
|-&lt;br /&gt;
| This previous command will create a new console application at the folder location. || [[Image:Language_csharp_cli_newproject.png|center|350px|link=https://cdn.phidgets.com/docs/images/c/cb/Language_csharp_cli_newproject.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Navigate back to the command prompt or terminal, and add the Phidget22.NET package with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dotnet add package Phidget22.NET&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 || [[Image:Language_csharp_cli_addpackage.png|center|350px|link=https://cdn.phidgets.com/docs/images/7/78/Language_csharp_cli_addpackage.png]]&lt;br /&gt;
|-&lt;br /&gt;
| You can now open the &#039;&#039;&#039;Program.cs&#039;&#039;&#039; file and add your code. Run the program by entering the following command into your command prompt or terminal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
dotnet run&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 || [[Image:Language_csharp_cli_runcode.png|center|350px|link=https://cdn.phidgets.com/docs/images/f/f3/Language_csharp_cli_runcode.png]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=CSharp Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_csharp_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/0/03/Language_csharp_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=CSharp Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=35442</id>
		<title>Language - Python</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Language_-_Python&amp;diff=35442"/>
		<updated>2026-03-06T17:00:06Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* macOS Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=Learn how to use Phidget USB devices with Python.}}&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
==Get Started==&lt;br /&gt;
With the Phidget22 Python library, it&#039;s easy to create Python applications that work with Phidget devices.&lt;br /&gt;
&lt;br /&gt;
==Python Libraries==&lt;br /&gt;
===pip Package===&lt;br /&gt;
The Phidget22 Python library is available as a [https://pypi.org/project/phidget22/ pip package]. Most development environments provide built-in tools to manage packages. View the [[#Development Environment Configuration | Development Environment Configuration]] section below for examples. &lt;br /&gt;
&lt;br /&gt;
====macOS Considerations====&lt;br /&gt;
Legacy Phidgets running a HID USB stack require a driver extension (macOS 10.15 and newer) or a kernel extension (macOS 10.14 and earlier). During development, we recommend downloading the appropriate [https://www.phidgets.com/docs/OS_-_macOS#Quick_Downloads package] which will install the extension. When deploying applications, review the README in the [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files] for information about bundling the extension with your application.&lt;br /&gt;
&lt;br /&gt;
=====Determining USB Stack=====&lt;br /&gt;
To determine which USB stack your device is running, navigate to the product page and then to the specification tab, and look for the &#039;&#039;USB Stack&#039;&#039; specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.&lt;br /&gt;
&lt;br /&gt;
[[Image:Javascript_networkserver_webusb_spec.png|center|600px|link=https://cdn.phidgets.com/docs/images/8/80/Javascript_networkserver_webusb_spec.png]]&lt;br /&gt;
&lt;br /&gt;
====Linux Considerations====&lt;br /&gt;
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you&#039;ll need to [{{SERVER}}/docs/OS_-_Linux#Setting_Udev_Rules set up udev rules] on your system.&lt;br /&gt;
&lt;br /&gt;
===Source Files===&lt;br /&gt;
The Phidget22 Python library source files are available [https://cdn.phidgets.com/downloads/phidget22/libraries/any/Phidget22Python.zip here].&lt;br /&gt;
&lt;br /&gt;
==Development Environment Configuration==&lt;br /&gt;
Most development environments provide built-in tools to manage Python interpreters, packages, and virtual environments. See the examples below for more information.&lt;br /&gt;
===Installing a Python Interpreter===&lt;br /&gt;
If you don&#039;t already have a Python interpreter installed, you can download and install one from [https://www.python.org/downloads/ python.org] or through package managers like [https://brew.sh/ Homebrew].&lt;br /&gt;
&lt;br /&gt;
===Visual Studio Code===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| Install the [https://marketplace.visualstudio.com/items?itemName=ms-python.python Python extension for Visual Studio Code].|| [[Image:Language_python_vscode_install.png|center|350px|link=https://cdn.phidgets.com/docs/images/f/f9/Language_python_vscode_install.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, create a directory and open it in Visual Studio Code. You can do this by opening Visual Studio Code and selecting &#039;&#039;&#039;File &amp;gt; Open Folder...&#039;&#039;&#039; || [[Image:Language_python_vscode_newfolder.png|center|350px|link=https://cdn.phidgets.com/docs/images/f/f8/Language_python_vscode_newfolder.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Open the Command Palette (Ctrl + Shift + P), type &#039;&#039;&#039;Python: Create Environment&#039;&#039;&#039;, and press Enter. Select &#039;&#039;&#039;Venv&#039;&#039;&#039; when prompted. || [[Image:Language_python_vscode_newvenv.png|center|350px|link=https://cdn.phidgets.com/docs/images/a/a6/Language_python_vscode_newvenv.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, select your preferred Python interpreter from the list. You may need to browse to find it. || [[Image:Language_python_vscode_selectinterpreter.png|center|350px|link=https://cdn.phidgets.com/docs/images/2/20/Language_python_vscode_selectinterpreter.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Open a new terminal. You can do this through the Command Palette again (Ctrl + Shift + P), by typing &#039;&#039;&#039;Terminal: Create New Terminal&#039;&#039;&#039;. Install the Phidget22 pip package: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#Windows&lt;br /&gt;
py -m pip install phidget22 &lt;br /&gt;
&lt;br /&gt;
#macOS&lt;br /&gt;
python3 -m pip install phidget22 &lt;br /&gt;
&lt;br /&gt;
#Linux (Debian)&lt;br /&gt;
python3 -m pip install phidget22&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
 || [[Image:Language_python_vscode_installpackage.png|center|350px|link=https://cdn.phidgets.com/docs/images/a/a8/Language_python_vscode_installpackage.png]]&lt;br /&gt;
|-&lt;br /&gt;
| Finally, add your Python file and run it using the button in the top right corner.|| [[Image:Language_python_vscode_runcode.png|center|350px|link=https://cdn.phidgets.com/docs/images/9/96/Language_python_vscode_runcode.png]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===PyCharm===&lt;br /&gt;
{| style=&amp;quot;margin:auto;&amp;quot; class=&amp;quot;table-no-border mw-collapsible mw-collapsed&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Instructions&#039;&#039;&#039;&lt;br /&gt;
| Create your PyCharm project and navigate to &#039;&#039;&#039;Settings&#039;&#039;&#039;: || [[Image:Windows_pycharm_settings.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/7/75/Windows_pycharm_settings.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Next, navigate to &#039;&#039;&#039;Project &amp;gt; Project Interpreter&#039;&#039;&#039; and click on the &#039;&#039;&#039;+&#039;&#039;&#039; symbol: || [[Image:Windows_pycharm_addpackage.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/6/6f/Windows_pycharm_addpackage.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Search for &#039;&#039;&#039;phidget22&#039;&#039;&#039; and install the package: || [[Image:Windows_pycharm_installpackage.jpg|center|350px|link=https://cdn.phidgets.com/docs/images/a/ad/Windows_pycharm_installpackage.jpg]]&lt;br /&gt;
|-&lt;br /&gt;
| Finally, add your Python file and run it using the button at the top of the screen: || [[Image:Windows_pycharm_run.png|center|350px|link=https://cdn.phidgets.com/docs/images/0/0a/Windows_pycharm_run.png]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Example Code==&lt;br /&gt;
Navigate to our [https://www.phidgets.com/?view=code_samples&amp;amp;lang=Python Code Sample Generator] to view and download code samples that are tailored to your specific device.&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_python_codesample.png|center|600px|link=https://cdn.phidgets.com/docs/images/2/2d/Language_python_codesample.png]]&lt;br /&gt;
&lt;br /&gt;
===Phidget Programming Basics===&lt;br /&gt;
{{PhidgetProgrammingBasicsLink}}&lt;br /&gt;
&lt;br /&gt;
==API==&lt;br /&gt;
[{{SERVER}}/?view=api&amp;amp;lang=Python Phidget22 API]&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=Asynchronous_Methods&amp;diff=35433</id>
		<title>Asynchronous Methods</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=Asynchronous_Methods&amp;diff=35433"/>
		<updated>2026-03-04T23:19:29Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Multiple Channels Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#seo:|description=This guide provides information about asynchronous methods with Phidget22.}}&lt;br /&gt;
[[Category:IntroGuide]]&lt;br /&gt;
__TOC__&lt;br /&gt;
==What Are Asynchronous Methods?==&lt;br /&gt;
Asynchronous methods allow you to send commands to a device &#039;&#039;without&#039;&#039; waiting for return codes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When calling a typical non-asynchronous method, your program must wait for the return code, blocking the rest of your program’s operation.&lt;br /&gt;
[[Image:Async_methods_typical_flow.png|center|link=]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When using an asynchronous method, your program can immediately continue executing and handle the return code in an asynchronous handler.&lt;br /&gt;
[[Image:Async_methods_async_flow.png|center|link=]]&lt;br /&gt;
&lt;br /&gt;
==When Should I Use Asynchronous Methods?==&lt;br /&gt;
There are two situations where asynchronous methods may be beneficial:&lt;br /&gt;
# When sending commands to multiple channels on the same device&lt;br /&gt;
# When sending commands to multiple channels on different devices&lt;br /&gt;
&lt;br /&gt;
===Multiple Channels Example===&lt;br /&gt;
[[Image:1032_0B.jpg|thumb|link=https://cdn.phidgets.com/docs/images/6/6d/1032_0B.jpg|&amp;lt;center&amp;gt;PhidgetLED-64 Advanced(1032_0)&amp;lt;/center&amp;gt;]]&lt;br /&gt;
The [https://www.phidgets.com/?prodid=1024 PhidgetLED-64 Advanced] features 64 channels, one for each LED. To turn all the LEDs on or off simultaneously, 64 sequential commands are necessary (one for each channel). In this situation, using asynchronous methods can drastically improve the performance of your application.&lt;br /&gt;
&lt;br /&gt;
===Multiple Devices Example===&lt;br /&gt;
The [https://www.phidgets.com/?prodid=712 Isolated 12-bit Voltage Output Phidget] is a single-channel device. If two or more of these devices were used in an application, it may be beneficial to use asynchronous methods.&lt;br /&gt;
&lt;br /&gt;
==How Do I Use Asynchronous Methods?==&lt;br /&gt;
Asynchronous methods are comprised of two parts:&lt;br /&gt;
* Asynchronous API call&lt;br /&gt;
* Asynchronous handler&lt;br /&gt;
&lt;br /&gt;
When calling an asynchronous method, you must assign an asynchronous handler. The Phidget22 libraries will then initiate the command and immediately return. The asynchronous handler will be called once the relevant communications have been completed to provide the return code from the device.&lt;br /&gt;
&lt;br /&gt;
===Code Example===&lt;br /&gt;
The code below provides a simple demonstration of how asynchronous methods can be used (while avoiding [[#Overloading|overloading]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=python&amp;gt;&lt;br /&gt;
from Phidget22.Phidget import *&lt;br /&gt;
from Phidget22.Devices.DigitalOutput import *&lt;br /&gt;
from Phidget22.ErrorCode import *&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
    digitalOutput0 = DigitalOutput()&lt;br /&gt;
&lt;br /&gt;
    digitalOutput0.openWaitForAttachment(5000)&lt;br /&gt;
&lt;br /&gt;
    #Assign new variables to track the number of calls made vs completed&lt;br /&gt;
    digitalOutput0.AsyncCalls = 0&lt;br /&gt;
    digitalOutput0.AsyncComplete = 0&lt;br /&gt;
    def AsyncResult(ch, res, details):&lt;br /&gt;
        ch.AsyncComplete += 1&lt;br /&gt;
        print(&amp;quot;Async Complete:&amp;quot; + str(ch.AsyncComplete))&lt;br /&gt;
        if res != ErrorCode.EPHIDGET_OK:&lt;br /&gt;
            print(&amp;quot;Async failure: %i : %s&amp;quot; % (res, details))&lt;br /&gt;
    &lt;br /&gt;
    while(1): #some loop condition&lt;br /&gt;
        #Here we check if the previous asynchronous call has completed before issuing a new one&lt;br /&gt;
        #If you had multiple asynchronous calls to make, you could (for example) give each its&lt;br /&gt;
        #own counter, or call a new batch of them once an entire set completes&lt;br /&gt;
        if(digitalOutput0.AsyncCalls == digitalOutput0.AsyncComplete):&lt;br /&gt;
            digitalOutput0.AsyncCalls += 1&lt;br /&gt;
            digitalOutput0.setDutyCycle_async(1, AsyncResult)&lt;br /&gt;
            # NOTE: Make sure to wait for async call to complete before closing the channel&lt;br /&gt;
        &lt;br /&gt;
        #Do other work here...&lt;br /&gt;
&lt;br /&gt;
    digitalOutput0.close()&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Java=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
import com.phidget22.*;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
&lt;br /&gt;
public class JavaApplication11 {&lt;br /&gt;
&lt;br /&gt;
    static int asyncCalls = 0;&lt;br /&gt;
    static int asyncComplete = 0;&lt;br /&gt;
    &lt;br /&gt;
    public static void main(String[] args) throws Exception {&lt;br /&gt;
        &lt;br /&gt;
        Phidget.resetLibrary();&lt;br /&gt;
        DigitalOutput digitalOutput0 = new DigitalOutput();&lt;br /&gt;
&lt;br /&gt;
        digitalOutput0.open(5000);&lt;br /&gt;
        &lt;br /&gt;
        while(asyncComplete &amp;lt; 1000) { //Some loop condition&lt;br /&gt;
            //Here we check if the previous asynchronous call has completed before issuing a new one&lt;br /&gt;
            //If you had multiple asynchronous calls to make, you could (for example) give each its&lt;br /&gt;
            //own counter, or call a new batch of them once an entire set completes&lt;br /&gt;
            if(asyncCalls == asyncComplete) {&lt;br /&gt;
                asyncCalls++;&lt;br /&gt;
                digitalOutput0.setDutyCycle(1, new AsyncListener() {&lt;br /&gt;
                    public void onAsyncCallback(AsyncResult ar) {&lt;br /&gt;
                        if (ar.getReturnCode() == ErrorCode.SUCCESS) {&lt;br /&gt;
                            asyncComplete++;&lt;br /&gt;
                            System.out.println(&amp;quot;Async Complete: &amp;quot; + asyncComplete);&lt;br /&gt;
                        }&lt;br /&gt;
                        else&lt;br /&gt;
                            System.out.println(&amp;quot;Async Failure: &amp;quot; + ar);&lt;br /&gt;
                    }&lt;br /&gt;
                });&lt;br /&gt;
                // NOTE: Make sure to wait for async call to complete before closing the channel&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            //Do other work here...&lt;br /&gt;
            Thread.sleep(1);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        digitalOutput0.close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
C#=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=cSharp&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using Phidget22;&lt;br /&gt;
&lt;br /&gt;
namespace ConsoleApplication&lt;br /&gt;
{&lt;br /&gt;
    class Program&lt;br /&gt;
    {&lt;br /&gt;
        static void Main(string[] args)&lt;br /&gt;
        {&lt;br /&gt;
            DigitalOutput digitalOutput0 = new DigitalOutput();&lt;br /&gt;
&lt;br /&gt;
            digitalOutput0.Open(5000);&lt;br /&gt;
&lt;br /&gt;
            digitalOutput0.DutyCycle = 1;&lt;br /&gt;
&lt;br /&gt;
            int asyncCalls = 0;&lt;br /&gt;
            int asyncComplete = 0;&lt;br /&gt;
            double dutyCycle = 0.1;&lt;br /&gt;
            while (true) /* Some loop condition */&lt;br /&gt;
            {&lt;br /&gt;
                //Here we check if the previous asynchronous call has completed before issuing a new one&lt;br /&gt;
                //If you had multiple asynchronous calls to make, you could (for example) give each its&lt;br /&gt;
                //own counter, or call a new batch of them once an entire set completes&lt;br /&gt;
                if (asyncCalls == asyncComplete)&lt;br /&gt;
                {&lt;br /&gt;
                    asyncCalls++;&lt;br /&gt;
                    digitalOutput0.BeginSetDutyCycle(dutyCycle, delegate (IAsyncResult result)&lt;br /&gt;
                    {&lt;br /&gt;
                        try&lt;br /&gt;
                        {&lt;br /&gt;
                            asyncComplete++;&lt;br /&gt;
                            digitalOutput0.EndSetDutyCycle(result);&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Async Complete: &amp;quot; + asyncComplete.ToString());&lt;br /&gt;
                        }&lt;br /&gt;
                        catch (PhidgetException ex)&lt;br /&gt;
                        {&lt;br /&gt;
                            Console.WriteLine(&amp;quot;Async Failure: &amp;quot; + ex.Message);&lt;br /&gt;
                        }&lt;br /&gt;
                    }, null);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                /*&lt;br /&gt;
                 *  Do other work were&lt;br /&gt;
                 */&lt;br /&gt;
            }&lt;br /&gt;
            digitalOutput0.Close();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
C=&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c&amp;gt;&lt;br /&gt;
#include &amp;lt;phidget22.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
void CCONV setDutyCycleDone(PhidgetHandle phid, void *ctx, PhidgetReturnCode res) {&lt;br /&gt;
    int *asyncComplete = (int*)ctx;&lt;br /&gt;
    (*asyncComplete)++;&lt;br /&gt;
    printf(&amp;quot;Async Complete : %d\n&amp;quot;, *asyncComplete);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main() {    &lt;br /&gt;
    PhidgetDigitalOutputHandle digitalOutput0;&lt;br /&gt;
    int asyncComplete;&lt;br /&gt;
    int asyncCalls;&lt;br /&gt;
&lt;br /&gt;
    PhidgetDigitalOutput_create(&amp;amp;digitalOutput0);&lt;br /&gt;
&lt;br /&gt;
    Phidget_openWaitForAttachment((PhidgetHandle)digitalOutput0, 5000);&lt;br /&gt;
&lt;br /&gt;
    PhidgetDigitalOutput_setDutyCycle(digitalOutput0, 1);&lt;br /&gt;
&lt;br /&gt;
    asyncComplete = 0;&lt;br /&gt;
    asyncCalls = 0;&lt;br /&gt;
    while (1) { //Some loop condition&lt;br /&gt;
&lt;br /&gt;
        //Here we check if the previous asynchronous call has completed before issuing a new one&lt;br /&gt;
        //If you had multiple asynchronous calls to make, you could (for example) give each its&lt;br /&gt;
        //own counter, or call a new batch of them once an entire set completes&lt;br /&gt;
        if (asyncCalls == asyncComplete) {&lt;br /&gt;
            asyncCalls++;&lt;br /&gt;
            PhidgetDigitalOutput_setDutyCycle_async(digitalOutput0, 1, setDutyCycleDone, &amp;amp;asyncComplete);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        //Do other work here...&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
    Phidget_close((PhidgetHandle)digitalOutput0);&lt;br /&gt;
&lt;br /&gt;
    PhidgetDigitalOutput_delete(&amp;amp;digitalOutput0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Other Considerations==&lt;br /&gt;
===Overloading===&lt;br /&gt;
If asynchronous methods are called faster than they can be dispatched, they will be added to a queue. In extreme cases, if the queue grows large enough, newer calls will be dropped and your async handler will complete with &#039;&#039;Phidget Error 0x10 NoSpace&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Single Device, Single Channel===&lt;br /&gt;
Asynchronous commands are not recommended when using a single device and a single channel. Multiple asynchronous calls to the same channel will be queued and issued one at a time as return codes are received for each, providing no benefit to your application.&lt;br /&gt;
&lt;br /&gt;
===Network Delays===&lt;br /&gt;
If you are accessing your device(s) over a network connection with high latency, you may benefit from using asynchronous methods.&lt;br /&gt;
&lt;br /&gt;
===Callback Handlers===&lt;br /&gt;
When programming using the [https://www.phidgets.com/docs/Language_-_C C language], a callback handler is required. If a callback handler is not provided, the method will not run asynchronously. In all other programming languages, a callback handler is recommended but optional.&lt;br /&gt;
&lt;br /&gt;
===VINT Communication Speed===&lt;br /&gt;
Asynchronous methods are particularly useful on VINT devices with lower [https://www.phidgets.com/docs/VINT_Communication_Speed_Guide communication speeds]. If you are working with USB devices or higher-speed VINT devices, the impact of asynchronous commands will be less significant.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:1032_0B.jpg&amp;diff=35432</id>
		<title>File:1032 0B.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:1032_0B.jpg&amp;diff=35432"/>
		<updated>2026-03-04T23:18:29Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35428</id>
		<title>OS - macOS</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35428"/>
		<updated>2026-03-04T17:50:26Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Phidget Control Panel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers, and relays with Phidgets! Program in macOS using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support macOS 10.11 and newer.&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/tools/macos/Phidget22ControlPanel.dmg Phidget22 Control Panel (macOS 10.15 and newer)]&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22.dmg Phidget22 Installer (macOS 10.14 and earlier)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files]&lt;br /&gt;
* [{{SERVER}}/downloads/phidget22/libraries/macos/Phidget22/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with macOS==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|package]] for your machine from the list above. This will install the Phidget Control Panel and the Phidget Network Server. These are powerful tools that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After downloading, drag the application into your Applications folder:&lt;br /&gt;
[[Image:Macos_standalone_install.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
You can then find the application in the Applications folder by searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
[[Image:Macos_applications_controlpanel.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|600px|center]]&lt;br /&gt;
&lt;br /&gt;
When you open the application for the first time, you will see the following notice:&lt;br /&gt;
[[Image:Macos_install_extension.png|link=https://cdn.phidgets.com/docs/images/9/9e/Macos_install_extension.png|300px|center]]&lt;br /&gt;
&lt;br /&gt;
Follow the link in the pop-up, or navigate to &#039;&#039;System Settings &amp;gt; General &amp;gt; Login Items &amp;amp; Extensions &amp;gt; Extensions&#039;&#039;, and give permissions:&lt;br /&gt;
[[Image:Macos_install_extension_permission.png|link=https://cdn.phidgets.com/docs/images/a/ac/Macos_install_extension_permission.png|600px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Note: The driver extension is only required for legacy USB Phidgets running a HID USB stack. Refer to your product’s specifications page for information about its USB stack.&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After running the application, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network.&lt;br /&gt;
[[Image:Os_macos_controlpanel.png|600px|link=https://cdn.phidgets.com/docs/images/a/a1/Os_macos_controlpanel.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the arrow beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Os_macos_controlpanel_example.png‎|link=https://cdn.phidgets.com/docs/images/3/37/Os_macos_controlpanel_example.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35425</id>
		<title>OS - macOS</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_macOS&amp;diff=35425"/>
		<updated>2026-03-04T17:10:12Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers, and relays with Phidgets! Program in macOS using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support macOS 10.11 and newer.&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/tools/macos/Phidget22ControlPanel.dmg Phidget22 Control Panel (macOS 10.15 and newer)]&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22.dmg Phidget22 Installer (macOS 10.14 and earlier)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [https://cdn.phidgets.com/downloads/phidget22/libraries/macos/Phidget22_macosdevel.zip macOS Development Files]&lt;br /&gt;
* [{{SERVER}}/downloads/phidget22/libraries/macos/Phidget22/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with macOS==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|package]] for your machine from the list above. This will install the Phidget Control Panel and the Phidget Network Server. These are powerful tools that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After downloading, drag the application into your Applications folder:&lt;br /&gt;
[[Image:Macos_standalone_install.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
You can then find the application in the Applications folder by searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
[[Image:Macos_applications_controlpanel.png|link=https://cdn.phidgets.com/docs/images/c/c8/Macos_applications_controlpanel.png|600px|center]]&lt;br /&gt;
&lt;br /&gt;
When you open the application for the first time, you will see the following notice:&lt;br /&gt;
[[Image:Macos_install_extension.png|link=https://cdn.phidgets.com/docs/images/9/9e/Macos_install_extension.png|300px|center]]&lt;br /&gt;
&lt;br /&gt;
Follow the link in the pop-up, or navigate to &#039;&#039;System Settings &amp;gt; General &amp;gt; Login Items &amp;amp; Extensions &amp;gt; Extensions&#039;&#039;, and give permissions:&lt;br /&gt;
[[Image:Macos_install_extension_permission.png|link=https://cdn.phidgets.com/docs/images/a/ac/Macos_install_extension_permission.png|600px|center]]&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;Note: The driver extension is only required for legacy USB Phidgets that use a HID USB stack. Refer to your product’s specifications page for information about its USB stack.&#039;&#039;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After running the application, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network.&lt;br /&gt;
[[Image:Os_macos_controlpanel.png|600px|link=https://cdn.phidgets.com/docs/images/a/a1/Os_macos_controlpanel.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the arrow beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Os_macos_controlpanel_example.png‎|link=https://cdn.phidgets.com/docs/images/3/37/Os_macos_controlpanel_example.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Os_macos_controlpanel.png&amp;diff=35424</id>
		<title>File:Os macos controlpanel.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Os_macos_controlpanel.png&amp;diff=35424"/>
		<updated>2026-03-04T17:08:08Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Os_macos_controlpanel_example.png&amp;diff=35423</id>
		<title>File:Os macos controlpanel example.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Os_macos_controlpanel_example.png&amp;diff=35423"/>
		<updated>2026-03-04T17:07:35Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Macos_install_extension_permission.png&amp;diff=35422</id>
		<title>File:Macos install extension permission.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Macos_install_extension_permission.png&amp;diff=35422"/>
		<updated>2026-03-04T17:06:29Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Macos_install_extension.png&amp;diff=35421</id>
		<title>File:Macos install extension.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Macos_install_extension.png&amp;diff=35421"/>
		<updated>2026-03-04T17:05:49Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Macos_applications_controlpanel.png&amp;diff=35420</id>
		<title>File:Macos applications controlpanel.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Macos_applications_controlpanel.png&amp;diff=35420"/>
		<updated>2026-03-04T17:05:27Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Macos_standalone_install.png&amp;diff=35419</id>
		<title>File:Macos standalone install.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Macos_standalone_install.png&amp;diff=35419"/>
		<updated>2026-03-04T17:05:10Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35418</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35418"/>
		<updated>2026-03-03T16:28:33Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers and relays with Phidgets! Program in Windows using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support Windows 8 and newer.&lt;br /&gt;
&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x64.exe Installer Download (64-bit)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-ARM64.exe Installer Download (ARM64)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x86.exe Installer Download (32-bit)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [[OS - Windows Advanced Information|Windows Advanced Information]]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Windows Development Files]&lt;br /&gt;
* [https://www.phidgets.com/downloads/phidget22/libraries/windows/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with Windows==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|installer]] for your machine from the list above. This will install the Phidget Control Panel and the Phidget Network Server. These are powerful tools that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After installing, you can find the application through your system tray, or by opening the start menu and searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Os_windows_systemtray.png|link=|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;&#039;+&#039;&#039;&#039; beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Controlpanel_openapplication.png|500px|link=https://cdn.phidgets.com/docs/images/b/bd/Controlpanel_openapplication.png|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35417</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35417"/>
		<updated>2026-03-02T22:27:56Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: /* Install */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers and relays with Phidgets! Program in Windows using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support Windows 8 and newer.&lt;br /&gt;
&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x64.exe Installer Download (64-bit)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-ARM64.exe Installer Download (ARM64)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x86.exe Installer Download (32-bit)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [[OS - Windows Advanced Information|Windows Advanced Information]]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Windows Development Files]&lt;br /&gt;
* [https://www.phidgets.com/downloads/phidget22/libraries/windows/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with Windows==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|installer]] for your machine from the list above. This will install the Phidget Control Panel and the Phidget Network Sever. These are powerful tools that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After installing, you can find the application through your system tray, or by opening the start menu and searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Os_windows_systemtray.png|link=|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;&#039;+&#039;&#039;&#039; beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Controlpanel_openapplication.png|500px|link=https://cdn.phidgets.com/docs/images/b/bd/Controlpanel_openapplication.png|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35416</id>
		<title>OS - Windows</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=OS_-_Windows&amp;diff=35416"/>
		<updated>2026-03-02T16:50:34Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;metadesc&amp;gt;Communicate over USB with sensors, controllers and relays with Phidgets! Program in Windows using a wide variety of programming languages.&amp;lt;/metadesc&amp;gt;&lt;br /&gt;
[[Category:OS]]&lt;br /&gt;
&lt;br /&gt;
==Quick Downloads==&lt;br /&gt;
Our libraries support Windows 8 and newer.&lt;br /&gt;
&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x64.exe Installer Download (64-bit)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-ARM64.exe Installer Download (ARM64)]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-x86.exe Installer Download (32-bit)]&lt;br /&gt;
&lt;br /&gt;
===Other Resources===&lt;br /&gt;
* [[OS - Windows Advanced Information|Windows Advanced Information]]&lt;br /&gt;
*[https://cdn.phidgets.com/downloads/phidget22/libraries/windows/Phidget22-windevel.zip Windows Development Files]&lt;br /&gt;
* [https://www.phidgets.com/downloads/phidget22/libraries/windows/ Previous Releases]&lt;br /&gt;
&lt;br /&gt;
==Getting Started with Windows==&lt;br /&gt;
===Install===&lt;br /&gt;
To get started, download the appropriate [[#Quick Downloads|installer]] for your machine from the list above. This will install the Phidget Control Panel, a powerful tool that will help you develop your Phidget applications.&lt;br /&gt;
&lt;br /&gt;
===Phidget Control Panel===&lt;br /&gt;
After installing, you can find the application through your system tray, or by opening the start menu and searching for &#039;&#039;Phidget Control Panel&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Os_windows_systemtray.png|link=|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After opening, you will see all the Phidgets that are plugged into your machine, as well as any Phidgets that are on your network. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Windows ControlPanel General.PNG|link=|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;&#039;+&#039;&#039;&#039; beside a device to expand it so that you can see all available channels. Double-click on one of these channels to open up a window that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Controlpanel_openapplication.png|500px|link=https://cdn.phidgets.com/docs/images/b/bd/Controlpanel_openapplication.png|alt=Windows Control Panel General|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Phidget Control Panel can be used for testing devices, updating firmware, enabling a Phidget Network Server, and more. Visit the [[Phidget Control Panel|Phidget Control Panel page]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Programming===&lt;br /&gt;
When you are ready to develop your own applications, visit our [{{SERVER}}/docs/Programming_Resources programming resources page] and select your programming language to get started.&lt;br /&gt;
&lt;br /&gt;
==Software License==&lt;br /&gt;
By downloading the installer and/or development files, you agree to adhere to the terms of the [{{SERVER}}/documentation/Licenses/Phidgets_EULA.pdf Phidgets End User License Agreement]. The Phidget libraries and development files are covered by the The 3-Clause BSD License.&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
	<entry>
		<id>https://www.phidgets.com/docs/index.php?title=File:Os_windows_systemtray.png&amp;diff=35415</id>
		<title>File:Os windows systemtray.png</title>
		<link rel="alternate" type="text/html" href="https://www.phidgets.com/docs/index.php?title=File:Os_windows_systemtray.png&amp;diff=35415"/>
		<updated>2026-03-02T16:49:11Z</updated>

		<summary type="html">&lt;p&gt;Lmpacent: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Lmpacent</name></author>
	</entry>
</feed>