$regfile = "Attiny2313.dat" Config Portb = Output Config Portd = Input Portd = &B11111111 Dim I As Integer Dim J As Integer Dim K As Integer Dim Wt1 As Integer Dim Wt2 As Integer Wt1 = 20 Wt2 = 500 Portb = &B11110101 Waitms Wt1 Portb = &B11111111 Waitms Wt2 I = 1 J = 1 Do If Pind.3 = 0 And I = 0 Then Portb.6 = 1 Portb.7 = 0 Waitms Wt1 Portb.7 = 1 I = 1 Waitms Wt2 End If If Pind.3 = 1 And I = 1 Then Portb.6 = 0 Portb.7 = 1 Waitms Wt1 Portb.6 = 1 I = 0 Waitms Wt2 End If Loop End