using System;
using System.Windows.Forms;
using Phidgets;
using Phidgets.Events;

namespace RFIDEx1
{
	public partial class Form1 : Form
	{
		RFID rfid;

		public Form1()
		{
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			rfid = new RFID();
			rfid.Tag += new TagEventHandler(rfid_Tag);
			rfid.TagLost += new TagEventHandler(rfid_TagLost);
			rfid.open();
		}

		void rfid_TagLost(object sender, TagEventArgs e)
		{
			textBox1.Text = string.Empty;
			rfid.LED = false;
		}

		void rfid_Tag(object sender, TagEventArgs e)
		{
			textBox1.Text = e.Tag;
			if(e.Tag == "30001d8794")
				rfid.LED = true;
		}
	}
}
