RFID Tag - Credit Card Datasheet
1023_1_Product_Manual created: 10/12/07 Page 6
Programming a Phidget
Where to get information
Go to •
www.phidgets.com >> downloads
Select the Operating System and the language you want to use.•
Download the appropriate API manual and read the section under the •
RFID heading.
Have a look at the source code of the •
RFID-full program.
Have a look at the C# example below.•
Modify an existing program or write your own program from scratch.•
Simple example written in C#
/* - RFID simple -
* This program simply displays the data that is generated by an RFID phidget in a very simple case and outputs
* it to the console. This simple example covers the basics of connecting and using an RFID phidget. For a
* more detailed example, see RFID-full.
*
* Please note that this example was designed to work with only one Phidget RFID connected.
* For an example using multiple Phidget RFIDs, please see a “multiple” example in the RFID Examples folder.
*
* Copyright 2007 Phidgets Inc.
* This work is licensed under the Creative Commons Attribution 2.5 Canada License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ca/
*/
using System;
using System.Collections.Generic;
using System.Text;
using Phidgets; //Needed for the RFID class and the PhidgetException class
using Phidgets.Events; //Needed for the phidget event handling classes
namespace RFID_simple
{
class Program
{
static void Main(string[] args)
{
try
{
RFID rd = new RFID(); //Declare an RFID object
//initialize our Phidgets RFID reader and hook the event handlers
rd.Attach += new AttachEventHandler(rd_Attach);
rd.Detach += new DetachEventHandler(rd_Detach);
rd.Error += new ErrorEventHandler(rd_Error);
rd.Tag += new TagEventHandler(rd_Tag);
rd.TagLost += new TagEventHandler(rd_TagLost);
rd.open();
//Wait for a Phidget RFID to be attached before doing anything with the object
Console.WriteLine(“waiting for attachment...”);
rd.waitForAttachment();
//turn on the antenna and the led to show everything is working