Creating a Channel: Difference between revisions
From Phidgets Support
(Created page with "{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} To control a Phidget channel, you must first create an instance of its channel class that will be used to keep t...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} | [[Category:Programming]]{{Recommended_Flow_Links|{{Flow Page Number|{{PAGENAME}} }} }} | ||
To control a Phidget channel, you must first create an instance of its channel class that will be used to keep track of the channel through your program. | To control a Phidget channel, you must first create an instance of its channel class that will be used to keep track of the channel through your program. | ||
Line 41: | Line 41: | ||
PhidgetRFIDHandle ch; | PhidgetRFIDHandle ch; | ||
PhidgetRFID_create(&ch); | PhidgetRFID_create(&ch); | ||
</syntaxhighlight> | |||
|-| | |||
Javascript=<syntaxhighlight lang=javascript> | |||
// Create a new Accelerometer channel | |||
const ch = new phidget22.Accelerometer() | |||
</syntaxhighlight> | |||
<syntaxhighlight lang=javascript> | |||
// Create a new RFID channel | |||
const ch = new phidget22.RFID() | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</tabber> | </tabber> | ||
{{Flow Navigation Buttons|{{Flow Page Number|{{PAGENAME}} }} }} | {{Flow Navigation Buttons|{{Flow Page Number|{{PAGENAME}} }} }} |
Latest revision as of 19:19, 19 April 2022
Phidget Programming Basics: Creating a Channel Table of Contents
4 . Creating a Channel
To control a Phidget channel, you must first create an instance of its channel class that will be used to keep track of the channel through your program.
For example:
# Create a new Accelerometer channel
accel = Accelerometer()
# Create a new RFID channel
rfid = RFID()
// Create a new Accelerometer channel
Accelerometer accel = new Accelerometer();
// Create a new RFID channel
RFID rfid = new RFID();
// Create a new Accelerometer channel
Accelerometer accel = new Accelerometer();
// Create a new RFID channel
RFID rfid = new RFID();
// Create a new Accelerometer channel
PhidgetAccelerometerHandle ch;
PhidgetAccelerometer_create(&ch);
// Create a new RFID channel
PhidgetRFIDHandle ch;
PhidgetRFID_create(&ch);
// Create a new Accelerometer channel
const ch = new phidget22.Accelerometer()
// Create a new RFID channel
const ch = new phidget22.RFID()