Kodigo
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
End Sub
Private Sub Timer1_Timer()
Escribir &H378, 1
Sleep(500)
Escribir &H378, 2
Sleep (500)
Escribir &H378, 4
Sleep (500)
Timer1.Enabled = False
End Sub
semaforo doble:
Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = TrueEnd Sub
Private Sub Timer1_Timer()
Escribir &H378, 33
Sleep (500)
Escribir &H378, 34
Sleep (500)
Escribir &H378, 12
Sleep (500)
Escribir &H378, 20
Sleep (500)
End Sub
semaforo simplecon parpadeo:
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Escribir &H378, 1
Sleep (1000)
For d = 1 To 6
Escribir &H378, 0
Sleep (200)Escribir &H378, 1
Sleep (200)
Next d
Escribir &H378, 2
Sleep (500)
Escribir &H378, 4
Sleep (1000)
End Sub
semaforo doble con parpadeo:
Private Sub Timer1_Timer()
Escribir&H378, 33
Sleep (1000)
For f = 1 To 5
Escribir &H378, 0
Sleep (200)
Escribir &H378, 17
Sleep (200)
Next f
Escribir &H378, 12
Sleep (1000)
For h = 1 To 5
Escribir &H378, 0
Sleep (200)Escribir &H378, 10
Sleep (200)
Next h
End Sub
bianrio:
Option Explicit
Private Function binario(decim As Long) As String
Dim d As String
Dim b As String
Dim m As Longm = decim
Do While m >= 1
d = d & (m Mod 2)
m = m / 2
Loop
b = StrReverse(d)
binario = b
End Function
Private Sub Command1_Click()Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
For g = 0 To 127
Escribir &H378, g
Sleep (200)
Text1.Text = g
Text1.Refresh
Text2.Text = binario(g)Text2.Refresh
Next g
Timer1.Enabled = False
End Sub
ascci:
Option Explicit
Private Sub Command1_Click()
Dim hu As String
hu = Asc(Text1.Text)
Label1.Caption = "El Valor Ascci...
Regístrate para leer el documento completo.