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
Line 41: Line 41:
  PhidgetRFIDHandle ch;
  PhidgetRFIDHandle ch;
  PhidgetRFID_create(&ch);
  PhidgetRFID_create(&ch);
</syntaxhighlight>
|-|
Javascript=<syntaxhighlight lang=javascript>
// Create a new Accelerometer channel
var ch = new phidget22.Accelerometer()
</syntaxhighlight>
<syntaxhighlight lang=javascript>
// Create a new RFID channel
var ch = new phidget22.RFID()
</syntaxhighlight>
</syntaxhighlight>
</tabber>
</tabber>


{{Flow Navigation Buttons|{{Flow Page Number|{{PAGENAME}} }} }}
{{Flow Navigation Buttons|{{Flow Page Number|{{PAGENAME}} }} }}

Revision as of 15:20, 9 April 2019

 Phidget Programming Basics: Creating a ChannelTOC Icon.png Table of Contents

Nav Back Arrow.png Nav Back Hover.png WhiteTab1.png HoverTab1.jpg WhiteTab2.png HoverTab2.jpg WhiteTab3.png HoverTab3.jpg GreenTab4.png WhiteTab5.png HoverTab5.jpg WhiteTab6.png HoverTab6.jpg WhiteTab7.png HoverTab7.jpg WhiteTab8.png HoverTab8.jpg WhiteTab9.png HoverTab9.jpg WhiteTab10.png HoverTab10.jpg WhiteTab11.png HoverTab11.jpg WhiteTab12.png HoverTab12.jpg WhiteTab13.png HoverTab13.jpg WhiteTab14.png HoverTab14.jpg WhiteTab15.png HoverTab15.jpg WhiteTab16.png HoverTab16.jpg Nav Next Arrow.png Nav Next Hover.png


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
 var ch = new phidget22.Accelerometer()
 // Create a new RFID channel
 var ch = new phidget22.RFID()