Bear with me as I'm new to this! I've just got a 1055 Phidget IR.
I'm trying to attach it but my code doesn't seem to work and the attaching doesn't happen. Can anybody see where I'm going wrong? Also, is the code in the sendcode sub correct for a simple transmit operation, specifically is the hex code contained in a string the correct format?
Thanks for looking.
Imports Phidget22
Imports Phidget22.Events
Public Class Form1
Dim PhidgetIR As Phidget22.IR
Dim CodeInfo As Phidget22.IRCodeInfo
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
phidgettimer.Start()
End Sub
Private Sub phidgettimer_Tick(sender As Object, e As EventArgs)
Handles phidgettimer.Tick
If PhidgetIR.Attached Then
connectedlabel.BackColor = Color.DarkGreen 'starts off red
connectedlabel.Text = "CONNECTED" 'starts off saying disconnected
phidgettimer.Stop()
SendCode()
End If
It looks like your code isn't waiting for the 1055 to be attached after it's opened.
Opening and attachment for Phidgets are separate steps of a Phidget program, where opening the Phidget has your program start looking for that Phidget, and the Phidget is attached once it is found and linked to your program.
If you put a parameter in the open call (e.g. PhidgetIR.Open(5000) ), your code will wait for the IR Phidget to be attached before proceeding.
For the transmit call, you can omit the "0x" part of your code string.
Try
PhidgetIR = New Phidget22.IR()
PhidgetIR.Open(1000)
Catch
End Try
If PhidgetIR.Attached Then
connectedlabel.BackColor = Color.DarkGreen
connectedlabel.Text = "CONNECTED"
phidgetTimer.Stop()
phidgetTimerLabel.Text = 0
mainTimer.Start()
End If
End Sub
Private Sub mainTimer_Tick(sender As Object, e As EventArgs) Handles mainTimer.Tick