lunes, 22 de noviembre de 2010

PRACTICA DE LEDS VISUAL

PRACTICA DE ENCENDIDO Y APAGADO DE LEDS MEDIANTE EL PUERTO PARALELO


CODIGO

VERSION 5.00
Begin VB.Form Form1
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   Caption         =   "Form1"
   ClientHeight    =   8970
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   9540
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   Picture         =   "Form1.frx":0000
   ScaleHeight     =   8970
   ScaleMode       =   0  'User
   ScaleWidth      =   9540
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton btnSalir
      Caption         =   "Salir"
      Height          =   375
      Left            =   2160
      TabIndex        =   28
      Top             =   7200
      Width           =   1455
   End
   Begin VB.VScrollBar VScroll1
      Height          =   375
      LargeChange     =   5
      Left            =   5280
      Max             =   0
      Min             =   10100
      SmallChange     =   100
      TabIndex        =   20
      Top             =   5040
      Value           =   100
      Width           =   255
   End
   Begin VB.TextBox txtVelocidadKitt
      Height          =   405
      Left            =   4320
      Locked          =   -1  'True
      TabIndex        =   19
      Top             =   5040
      Width           =   1215
   End
   Begin VB.PictureBox imgPrendiRojo
      Height          =   135
      Left            =   5880
      Picture         =   "Form1.frx":58AA
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   18
      Top             =   1200
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.PictureBox imgPrendiAmarillo
      Height          =   135
      Left            =   4200
      Picture         =   "Form1.frx":5E6C
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   17
      Top             =   1200
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.PictureBox imgPrendiVerde
      Height          =   135
      Left            =   2400
      Picture         =   "Form1.frx":642E
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   16
      Top             =   1200
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.PictureBox imgApagRojo
      Height          =   135
      Left            =   5880
      Picture         =   "Form1.frx":69F0
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   15
      Top             =   1200
      Width           =   615
   End
   Begin VB.PictureBox imgApagAmarillo
      Height          =   135
      Left            =   4200
      Picture         =   "Form1.frx":6FB2
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   14
      Top             =   1200
      Width           =   615
   End
   Begin VB.PictureBox imgApagVerde
      Height          =   135
      Left            =   2400
      Picture         =   "Form1.frx":7574
      ScaleHeight     =   75
      ScaleWidth      =   555
      TabIndex        =   13
      Top             =   1200
      Width           =   615
   End
   Begin VB.Timer tmrSecuencia3
      Left            =   1200
      Top             =   5400
   End
   Begin VB.CommandButton btnSecuencia3
      Caption         =   "Secuencia 3"
      Height          =   375
      Left            =   2040
      TabIndex        =   12
      Top             =   6000
      Width           =   1695
   End
   Begin VB.Timer tmrSecuencia2
      Left            =   1200
      Top             =   4800
   End
   Begin VB.CommandButton btnSMotor
      Caption         =   "Secuencia Motor"
      Height          =   375
      Left            =   4200
      TabIndex        =   11
      Top             =   6000
      Width           =   1695
   End
   Begin VB.Timer tmrMotor
      Left            =   480
      Top             =   6000
   End
   Begin VB.CommandButton btnSecuencia2
      Caption         =   "Secuencia 2"
      Height          =   375
      Left            =   6360
      TabIndex        =   10
      Top             =   4560
      Width           =   1695
   End
   Begin VB.Timer tmrSemaforo
      Left            =   480
      Top             =   5400
   End
   Begin VB.CommandButton btnSemaforo
      Caption         =   "Semáforo"
      Height          =   375
      Left            =   6360
      TabIndex        =   9
      Top             =   6000
      Width           =   1695
   End
   Begin VB.Timer Timer1
      Left            =   480
      Top             =   4800
   End
   Begin VB.CommandButton btnSecuencia
      Caption         =   "Secuencia Kitt"
      Height          =   375
      Left            =   4200
      TabIndex        =   7
      Top             =   4200
      Width           =   1695
   End
   Begin VB.CommandButton btnRojoAmarillo
      Caption         =   "Led Amarillo y Rojo"
      Height          =   375
      Left            =   4200
      TabIndex        =   6
      Top             =   3120
      Width           =   1695
   End
   Begin VB.CommandButton btnLed10
      Caption         =   "Apagar todos"
      Height          =   375
      Left            =   2040
      TabIndex        =   5
      Top             =   4560
      Width           =   1695
   End
   Begin VB.CommandButton btnLed9
      Caption         =   "Prender todos"
      Height          =   375
      Left            =   6360
      TabIndex        =   4
      Top             =   3120
      Width           =   1695
   End
   Begin VB.CommandButton btnMotor
      Caption         =   "Motor / Led Rojo"
      Height          =   375
      Left            =   6360
      TabIndex        =   3
      Top             =   1920
      Width           =   1695
   End
   Begin VB.CommandButton btnLed7
      BackColor       =   &H8000000D&
      Caption         =   "Led Verde"
      Height          =   375
      Left            =   2040
      TabIndex        =   2
      Top             =   1920
      Width           =   1575
   End
   Begin VB.CommandButton btnLed6
      Caption         =   "Led Amarillo"
      Height          =   375
      Left            =   4200
      TabIndex        =   1
      Top             =   1920
      Width           =   1575
   End
   Begin VB.CommandButton btnLed5
      Caption         =   "Led Verde y Amarillo"
      Height          =   375
      Left            =   2040
      TabIndex        =   0
      Top             =   3120
      Width           =   1695
   End
   Begin VB.Label Label7
      BackStyle       =   0  'Transparent
      Caption         =   "2008 ©"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      TabIndex        =   27
      Top             =   8400
      Width           =   3135
   End
   Begin VB.Label Label6
      BackStyle       =   0  'Transparent
      Caption         =   "Quito - Ecuador"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      TabIndex        =   26
      Top             =   8160
      Width           =   3135
   End
   Begin VB.Label Label5
      BackStyle       =   0  'Transparent
      Caption         =   "6to ""A"" Telemática"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      TabIndex        =   25
      Top             =   7920
      Width           =   3135
   End
   Begin VB.Label Label4
      BackStyle       =   0  'Transparent
      Caption         =   "Gabriel Reyes"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      TabIndex        =   24
      Top             =   7680
      Width           =   3135
   End
   Begin VB.Label Label3
      BackStyle       =   0  'Transparent
      Caption         =   "Hugo Mora"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6120
      TabIndex        =   23
      Top             =   7440
      Width           =   3135
   End
   Begin VB.Label Label2
      BackStyle       =   0  'Transparent
      Caption         =   "Trabajo de Arquitectura de PC's"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6120
      TabIndex        =   22
      Top             =   6960
      Width           =   3135
   End
   Begin VB.Line Line9
      X1              =   6120
      X2              =   6120
      Y1              =   1680
      Y2              =   6720
   End
   Begin VB.Line Line8
      X1              =   3960
      X2              =   3960
      Y1              =   1680
      Y2              =   6720
   End
   Begin VB.Line Line7
      X1              =   1800
      X2              =   8280
      Y1              =   5640
      Y2              =   5640
   End
   Begin VB.Line Line6
      X1              =   1800
      X2              =   8280
      Y1              =   3840
      Y2              =   3840
   End
   Begin VB.Line Line5
      X1              =   1800
      X2              =   8280
      Y1              =   2640
      Y2              =   2640
   End
   Begin VB.Line Line4
      X1              =   8280
      X2              =   8280
      Y1              =   1680
      Y2              =   6720
   End
   Begin VB.Line Line3
      X1              =   1800
      X2              =   8280
      Y1              =   6720
      Y2              =   6720
   End
   Begin VB.Line Line2
      X1              =   1800
      X2              =   8280
      Y1              =   1680
      Y2              =   1680
   End
   Begin VB.Line Line1
      X1              =   1800
      X2              =   1800
      Y1              =   1680
      Y2              =   6720
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Velocidad"
      BeginProperty Font
         Name            =   "Verdana"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   4440
      TabIndex        =   21
      Top             =   4680
      Width           =   1095
   End
   Begin VB.Label lblCuenta
      BackColor       =   &H8000000A&
      Caption         =   "             "
      Height          =   255
      Left            =   480
      TabIndex        =   8
      Top             =   4320
      Visible         =   0   'False
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Private Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Dim a, b, c, d, e, f As Integer

Private Sub btnLed10_Click()
    PortOut &H378, 0
    Me.Timer1 = False
    Me.tmrSemaforo = False
    Me.tmrMotor = False
    Me.tmrSecuencia2 = False
    Me.tmrSecuencia3 = False
    a = 0
    b = 0
    c = 0
    d = 0
    e = 0
    f = 0
    Me.imgApagAmarillo.Visible = True
    Me.imgApagRojo.Visible = True
    Me.imgApagVerde.Visible = True
    Me.imgPrendiAmarillo.Visible = False
    Me.imgPrendiRojo.Visible = False
    Me.imgPrendiVerde.Visible = False
End Sub
Private Sub btnLed5_Click()
    If Me.imgApagAmarillo.Visible = True And Me.imgApagVerde.Visible = True Then
        PortOut &H378, 96
        Me.imgPrendiAmarillo.Visible = True
        Me.imgPrendiVerde.Visible = True
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = False
        Me.imgApagVerde.Visible = False
        Me.imgApagRojo.Visible = True
    Else
        PortOut &H378, 0
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = True
    End If
End Sub
Private Sub btnLed6_Click()
    If Me.imgApagAmarillo.Visible = True Then
            PortOut &H378, 32
            Me.imgPrendiAmarillo.Visible = True
            Me.imgPrendiVerde.Visible = False
            Me.imgPrendiRojo.Visible = False
            imgApagAmarillo.Visible = False
            Me.imgApagVerde.Visible = True
            Me.imgApagRojo.Visible = True
        Else
            PortOut &H378, 0
            Me.imgPrendiAmarillo.Visible = False
            Me.imgPrendiVerde.Visible = False
            Me.imgPrendiRojo.Visible = False
            imgApagAmarillo.Visible = True
            Me.imgApagVerde.Visible = True
            Me.imgApagRojo.Visible = True
        End If
End Sub
Private Sub btnLed7_Click()
    If Me.imgApagVerde.Visible = True Then
        PortOut &H378, 64
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = False
        Me.imgApagRojo.Visible = True
    Else
        PortOut &H378, 0
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = True
    End If
End Sub
Private Sub btnLed9_Click()
    If Me.imgApagAmarillo.Visible = True And Me.imgApagVerde.Visible = True And Me.imgApagRojo.Visible = True Then
        PortOut &H378, 255
        Me.imgPrendiAmarillo.Visible = True
        Me.imgPrendiVerde.Visible = True
        Me.imgPrendiRojo.Visible = True
        imgApagAmarillo.Visible = False
        Me.imgApagVerde.Visible = False
        Me.imgApagRojo.Visible = False
    Else
        PortOut &H378, 0
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = True
    End If
End Sub
Private Sub btnMotor_Click()
    If Me.imgApagRojo.Visible = True Then
        PortOut &H378, 128
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = True
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = False
    Else
        PortOut &H378, 0
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = True
    End If
End Sub
Private Sub btnRojoAmarillo_Click()
    'PortOut &H378, 160
    If Me.imgApagAmarillo.Visible = True And Me.imgApagRojo.Visible = True Then
        PortOut &H378, 160
        Me.imgPrendiAmarillo.Visible = True
        Me.imgPrendiRojo.Visible = True
        Me.imgPrendiVerde.Visible = False
        imgApagAmarillo.Visible = False
        Me.imgApagRojo.Visible = False
        Me.imgApagVerde.Visible = True
    Else
        PortOut &H378, 0
        Me.imgPrendiAmarillo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgPrendiRojo.Visible = False
        imgApagAmarillo.Visible = True
        Me.imgApagVerde.Visible = True
        Me.imgApagRojo.Visible = True
    End If
End Sub

Private Sub btnSalir_Click()
    End
End Sub
Private Sub btnSecuencia_Click()
    If Me.txtVelocidadKitt.Text = "" Or Me.txtVelocidadKitt.Text = "0" Then
        MsgBox "Seleccione algún valor de velocidad mayor a cero"
    Else
         Me.Timer1.Interval = CInt(Me.txtVelocidadKitt.Text)
         Me.Timer1 = True
    End If
End Sub
Private Sub btnSecuencia2_Click()
    Me.tmrSecuencia2.Interval = 1000
    Me.tmrSecuencia2 = True
End Sub
Private Sub btnSecuencia3_Click()
    Me.tmrSecuencia3.Interval = 1000
    Me.tmrSecuencia3 = True
End Sub
Private Sub btnSemaforo_Click()
    Me.tmrSemaforo.Interval = 1000
    Me.tmrSemaforo = True
End Sub

Private Sub btnSMotor_Click()
    Me.tmrMotor.Interval = 1000
    Me.tmrMotor = True
End Sub

Private Sub Timer1_Timer()
    a = a + 1
    lblCuenta.Caption = a
 
    'Secuencia del Kitt
    If a = 1 Then
        PortOut &H378, 64
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf a = 2 Then
        PortOut &H378, 32
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
    ElseIf a = 3 Then
        PortOut &H378, 128
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = False
        Me.imgPrendiRojo.Visible = True
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
    ElseIf a = 4 Then
        PortOut &H378, 32
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
        a = 0
    End If
End Sub
Private Sub tmrMotor_Timer()
    c = c + 1
    d = d + 1
    If c = 1 Then
        PortOut &H378, 64
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf c = 2 Then
        PortOut &H378, 0
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
        c = 0
    End If
    If d = 8 Then
        PortOut &H378, 128
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = False
        Me.imgPrendiRojo.Visible = True
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
        Me.tmrMotor = False
    End If
   
    Me.lblCuenta.Caption = d
End Sub
Private Sub tmrSecuencia2_Timer()
    e = e + 1
     'Secuencia 2
    If e = 1 Then
        PortOut &H378, 64
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf e = 3 Then
        PortOut &H378, 32
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
    ElseIf e = 5 Then
        PortOut &H378, 96
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
        e = 0
    ElseIf (e Mod 2) = 0 Then
        PortOut &H378, 0
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
    End If
End Sub
Private Sub tmrSecuencia3_Timer()
    f = f + 1
    'Secuencia 2
    If f = 1 Then
        PortOut &H378, 64
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf f = 2 Then
        PortOut &H378, 32
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = False
        Me.imgApagVerde.Visible = True
        f = 0
    End If
End Sub
Private Sub tmrSemaforo_Timer()
    b = b + 1
    If b = 1 Then
        PortOut &H378, 64
        Me.imgApagAmarillo.Visible = True
        Me.imgPrendiAmarillo.Visible = False
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf b = 4 Then
        PortOut &H378, 96
        Me.imgApagAmarillo.Visible = False
        Me.imgPrendiAmarillo.Visible = True
        Me.imgApagRojo.Visible = True
        Me.imgPrendiRojo.Visible = False
        Me.imgPrendiVerde.Visible = True
        Me.imgApagVerde.Visible = False
    ElseIf b = 6 Then
         PortOut &H378, 128
         Me.imgApagAmarillo.Visible = True
         Me.imgPrendiAmarillo.Visible = False
         Me.imgApagRojo.Visible = False
         Me.imgPrendiRojo.Visible = True
         Me.imgPrendiVerde.Visible = False
         Me.imgApagVerde.Visible = True
    ElseIf b = 9 Then
         b = 0
    End If
    
End Sub
Private Sub VScroll1_Change()
    Me.txtVelocidadKitt.Text = CInt(VScroll1.Value)
End Sub

PROTOBOARD TERMINADO:

Aqui se muestra el Protoboard ya terminado con los Leds y el Puerto Paralelo:


Aqui se muestra el Protoboard ya terminado con los Leds:


En esta Imagen el Protoboard con la estudiante del equipo:


En esta imagen se muestra el Programa ya ejecutado:

PRACTICA DE LEDS TEORIA

PRACTICA DE ENCENDIDO Y APAGADO DE LEDS MEDIANTE EL PUERTO PARALELO



INTRODUCCION
A continuación realizaremos la práctica del Encendido y Apagado de Leds a través de un Puerto Paralelo por lo cual se creó un Programa el cual emite señales para los Leds a través del Protoboard los cuales se verán a continuación:

MATERIALES:
1)     1 Cable de Impresora Paralelo (UTP)
2)     3 Leds de Colores Verde Rojo & Amarillo
3)     3 Resistencias de ½
4)     1 Protoboard
5)     1 Cautin
6)     Tubo de Estaño
7)     Grasa Residual para quitar los Residuos de Estaño en el Cautin


SOFTWARE:
Visual Basic 6.0

INFORMACION NECESARIA:
Un puerto paralelo es una interfaz entre una computadora y un periférico cuya principal característica es que los bits de datos viajan juntos enviando un byte completo o más a la vez. Es decir, se implementa un cable o una vía física para cada bit de datos formando un bus.
El cable paralelo es el conector físico entre el puerto paralelo y el periférico. En un puerto paralelo habrá una serie de bits de control en vías aparte que irán en ambos sentidos por caminos distintos.
En contraposición al puerto paralelo está el Puerto serie, que envía los datos bit a bit por el mismo hilo.
La estructura consta de tres registros: de control, de estado y de datos.
El registro de control es un bidireccional de 4 bits, con un bit de configuración que no tiene conexión al exterior, su dirección en el LPT1 es 0x37A.
El registro de estado, se trata de un registro de entrada de información de 5 bits, su dirección en el LPT1 es 0×379.
El registro de datos, se compone de 8 bits, es bidireccional. Su dirección en el LPT1 es 0×378.

Conector DB25:
Conector DB25
El Dataport se usa como salida
El Statusport se usa como entrada
El Controlport se usa de las dos formas anteriores


PROCEDIMIENTO:
Con esos antecedentes ahora vamos a explicar los detalles del circuito:

El Circuito
A continuación se muestra una Imagen la cual es como debe de quedar el Diagrama del Circuito:
Donde dice "Pin puerto paralelo" puede ser cualquier Pin del 2 al 9. No olvidar hacer una conexión al pin 25 que es tierra
El circuito consiste en un Led con una resistencia, la resistencia se usa para limitar la intensidad y no pedir más de la que el puerto paralelo es capaz de dar (5 mA). Cuando se active el pin el Led se encenderá.
En este proyecto lo que se quiere mostrar es como, con un simple circuito, se puede controlar mediante la computadora una fila de Leds los que se van a encender en una secuencia que nosotros vamos a controlar con un pequeño programa escrito en el lenguaje de programación Visual Basic 6.0.
El circuito que se va armar será montado sobre una plaqueta, la cual conduce la corriente eléctrica, llamada “Protoboard”.
Nuestro objetivo es controlar los diodos Leds con la computadora, esto es encenderlos y apagarlos según como queramos. Los Leds son diodos que tienen la capacidad de emitir luz cuando circula una corriente por ellos. Esta corriente debe ser del orden de los 10 mA (miliampers). Para limitar la corriente que pasa por los Leds se usan las resistencias que se oponen al paso de ella.
Para controlar un circuito externo con la computadora se usará el puerto paralelo de ella, para conectar el puerto con el circuito se necesitará el cable paralelo o conector DB-25. El paso siguiente es soldar cable fino UTP a los pines internos del conector. Como los pines están numerados del número 1 al 25, solo usaremos los pines numerados del 2 al 9, también se tiene que soldar un cable al pin 25 (que es el pin de masa o tierra eléctrica) para tener una descarga a tierra común, para nuestro circuito y la computadora. Una vez construido el cable se lo puede conectar al Protoboard.
Solo se deben usar tres entradas y tres salidas, ya que son solo tres Leds los que controlamos. Las tres salidas están conectadas por medio de una resistencia limitadora de corriente a una LED cada una. Estas resistencias son de un valor de 330 ohm y permite que circule una corriente de 10 mA (miliampere) por cada diodo.


                                                        FOTOS DEL CIRCUITO:         
Las siguientes imágenes pueden ayudar a apreciar mejor la conexión del circuito:
Las imágenes muestran cómo está hecha la conexión en el Protoboard.


Gráfico 1. Circuito armado en el Protoboard.


Gráfico 2. Circuito armado en el Protoboard.


Gráfico 3. Circuito armado en el Protoboard.


Gráfico 4. Circuito armado en el Protoboard.


Gráfico 5. Circuito armado en el Protoboard.


Gráfico 6. Circuito armado en el Protoboard.


Gráfico 7. Circuito armado en el Protoboard.


Gráfico 8. Circuito armado en el Protoboard.


Gráfico 9. Circuito armado en el Protoboard.