Phidget 1055 code issues
Posted: Thu Feb 28, 2019 8:07 pm
Hi,
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.
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
timerlabel.Text = Integer.Parse(timerlabel.Text) + 1
PhidgetIR = New Phidget22.IR()
PhidgetIR.Open()
' doesn't go beyond this point
If PhidgetIR.Attached Then
connectedlabel.BackColor = Color.DarkGreen 'starts off red
connectedlabel.Text = "CONNECTED" 'starts off saying disconnected
phidgettimer.Stop()
SendCode()
End If
End Sub
Private Sub SendCode()
CodeInfo.BitCount = 12
CodeInfo.Length = 2
CodeInfo.Encoding = 3
CodeInfo.Gap = 44563
'CodeInfo.Trail = 0
CodeInfo.Zero = {548, 640}
CodeInfo.One = {1139, 640}
CodeInfo.Header = {2356, 640}
'CodeInfo.Repeat = {9000, 2253, 555}
'CodeInfo.ToggleMask = 0
PhidgetIR.Transmit("0x0290", CodeInfo)
End Sub
End Class