Creating a Channel

From Phidgets Support
Jump to: navigation, search
 Phidget Programming Basics: Creating a ChannelTOC Icon.png Table of Contents

Nav Back Arrow.pngNavSpacer.jpgWhiteTab1.pngNavSpacer.jpgWhiteTab2.pngNavSpacer.jpgWhiteTab3.pngNavSpacer.jpgGreenTab4.pngNavSpacer.jpgWhiteTab5.pngNavSpacer.jpgWhiteTab6.pngNavSpacer.jpgWhiteTab7.pngNavSpacer.jpgWhiteTab8.pngNavSpacer.jpgWhiteTab9.pngNavSpacer.jpgWhiteTab10.pngNavSpacer.jpgWhiteTab11.pngNavSpacer.jpgWhiteTab12.pngNavSpacer.jpgWhiteTab13.pngNavSpacer.jpgWhiteTab14.pngNavSpacer.jpgWhiteTab15.pngNavSpacer.jpgWhiteTab16.pngNavSpacer.jpgNav Next Arrow.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()