Napisałem programik:
I tak jak na PD1 i PD2 są złączone switchem.
jak moje urządzenie dostanie sygnał z PD0 to daje sygnał na nogi PB0-6
Znaczy ma dawać bo sekwencji migania LED nie ma.
Co możne być żle?
Cytat:$regfile = "attiny2313.dat"
$crystal = 1000000
Config Portb = Input
Portb = &B11111111
Config Portd.4 = Output
Portd.4 = 1
Config Portd.0 = Output
Portd.0 = 1
Config Portd.1 = Input
Portd.1 = 1
Config Portd.2 = Output
Portd.2 = 0
Do
If Pind.1 = 0 Then
Waitms 100
Portd.0 = 0
Waitms 100
Portd.0 = 1
Portd.2 = 1
Wait 1
Portd.2 = 0
End If
If Pind.1 = 0 And Pinb.1 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
If Pind.1 = 0 And Pinb.2 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
If Pind.1 = 0 And Pinb.3 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
If Pind.1 = 0 And Pinb.4 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
If Pind.1 = 0 And Pinb.5 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
If Pind.1 = 0 And Pinb.6 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
End If
If Pind.1 = 0 And Pinb.7 = 0 Then
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
Portd.4 = 0
Waitms 1
Portd.4 = 1
Waitms 1
End If
Loop
End 'end program
I tak jak na PD1 i PD2 są złączone switchem.
jak moje urządzenie dostanie sygnał z PD0 to daje sygnał na nogi PB0-6
Znaczy ma dawać bo sekwencji migania LED nie ma.
Co możne być żle?