NECESSITO AYUDA

Roger
19 de Abril del 2005
Private Sub Command1_Click()

Dim x As Boolean
Dim cx As Boolean
Dim y As Integer
Dim iCounter As Integer
Dim t As Integer
Dim threshold As Integer
Dim ni As Integer

threshold = 70
FORM6.Phantom.SetVar threshold, 2, 70
Label3.Caption = "Threshold or sensibility=" & threshold
FORM6.Phantom.SetSensorType SENSOR_1, TYPE_SWITCH
FORM6.Phantom.SetSensorType SENSOR_2, TYPE_LIGHT
FORM6.Phantom.SetSensorMode SENSOR_1, 1, 0 '(Number, Mode, Slope (0..31))
FORM6.Phantom.SetSensorMode SENSOR_2, 4, 15
FORM6.Phantom.SetPower 0 + 2, 2, 2
x = FORM6.Phantom.Poll(13, SENSOR_1)
y = FORM6.Phantom.Poll(9, SENSOR_2)
Label1.Caption = "Value of light sensor=" & y
Label2.Caption = "Valor del switch sensor=" & x

While 1

x = FORM6.Phantom.Poll(13, SENSOR_1)
y = FORM6.Phantom.Poll(9, SENSOR_2)
Label1.Caption = "Value of light sensor=" & y
Label2.Caption = "Valor del switch sensor=" & x

Select Case 1


Case y < threshold And x = False

FORM6.Phantom.On 1
FORM6.Phantom.SetFwd 1
FORM6.Phantom.On 2
FORM6.Phantom.SetRwd 2
y = FORM6.Phantom.Poll(9, SENSOR_2)

Case y > threshold And x = False

x = FORM6.Phantom.Poll(13, SENSOR_1)
FORM6.Phantom.On 1 + 2
FORM6.Phantom.SetFwd 1 + 2
y = FORM6.Phantom.Poll(9, SENSOR_2)

Case x = True

FORM6.Phantom.On 1 + 2
FORM6.Phantom.SetRwd 1 + 2

End Select

Wend

End Sub

NECESITO SABER PORQUE NO ENTRA EN NINGUN CASO
YO SUPONGO QUE ES FALLO DE HACER CORRECTAMENTE LA INSTRUCCION SELECT CASE
GRACIAS POR LA AYUDA!