Template:PT3 JS ANY NODE: Difference between revisions
From Phidgets Support
(Created page with "<div class="phd-slide-deck" data-deck="PT3_JS_ANY_NODE"> <div class="phd-slide-deck-header"><h3>Language - JavaScript</h3></div> <div class="phd-slides"> <div class="phd-slide...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
<h2>Requirements</h2> | <h2>Requirements</h2> | ||
<p> | <p> | ||
If you're on MacOS and plan on using any USB Phidgets that use the HID stack, you'll need to install the | |||
<span>[https://www.phidgets.com/docs/OS_-_macOS Phidget drivers for MacOS]</span>. You can check which stack your USB Phidgets use by checking the 'USB Stack' | |||
in the product specifications. If all of your Phidgets use the PHIDUSB stack or you're on Windows or Linux, you can skip installing the drivers since they're | |||
packaged with the Javascript libraries. | |||
</p> | |||
<p>● <span>[https://nodejs.org/ Node.js]</span></p> | <p>● <span>[https://nodejs.org/ Node.js]</span></p> | ||
Line 27: | Line 30: | ||
<br /> | <br /> | ||
<h2>Version | <h2>Version History</h2> | ||
<p><b>1.x.x</b> - Initial Release (unstable- highly recommend updating to 2.x.x or newer)</p> | |||
<p> | <p><b>2.x.x</b> - Fixed stability issues</p> | ||
<b> | |||
<p><b>3.x.x</b> - Added WebUSB support for VINT devices</p> | |||
</p> | |||
<p>Each release has potential breaking changes, so you should always revisit your code when updating to a new major release.</p> | |||
</div> | </div> | ||
<div class="phd-slide"> | <div class="phd-slide"> | ||
<h2>Phidget Network Server</h2> | <h2>JavaScript using the Phidget Network Server</h2> | ||
<p> | <p> | ||
Go to the <span>[https://www.phidgets.com/docs/Phidget_Network_Server#Using_The_Network_Server this page]</span> and select the tab with your OS to get the | |||
Network Server set up. | |||
</p> | </p> | ||
<p> | <p> | ||
Line 53: | Line 56: | ||
<p> | <p> | ||
The Phidget Server Webserver can be used to serve files - such as the Phidget JavaScript library, or your own projects. By default, it serves the JavaScript | The Phidget Server Webserver can be used to serve files - such as the Phidget JavaScript library, or your own projects. By default, it serves the JavaScript | ||
control panel files. | control panel files. | ||
</p> | |||
<p> | |||
In order to connect remotely, you need to use the <b>NetworkConnection</b> object. When you download a code sample later in this guide, make sure the | |||
<b>Remote</b> box is checked. | |||
</p> | |||
<h2>JavaScript using WebUSB</h2> | |||
<p> | |||
For library version 3.x.x or newer, you can connect to Phidgets plugged in locally via USB without having the Network Server running. This feature is only | |||
supported on Phidgets that use the PHIDUSB stack. You can see which stack your USB Phidgets use by checking the specifications table. | |||
</p> | |||
<p> | |||
In order to connect using USB, you need to use the <b>USBConnection</b> object. When you download a code sample later in this guide, make sure the | |||
<b>Remote</b> box is unchecked. | |||
</p> | </p> | ||
</div> | </div> | ||
Line 102: | Line 121: | ||
<p>Once you've made your selections, click the <b>Download Example</b> button to download a sample script.</p> | <p>Once you've made your selections, click the <b>Download Example</b> button to download a sample script.</p> | ||
<div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_JS_ANY_NODE/- | <div class="phd-lazy-image" data-src="https://www.phidgets.com/decks/PT3_JS_ANY_NODE/-x310/50/JavaScript_Sample_Code_Download.png"></div> | ||
</div> | </div> | ||