Witam.. Od godziny próbuję dojść czemu wyświetlacz tak niemiłosiernie mruga. Gdyby ktoś mógł rzucić na to okiem:
$regfile = "attiny2313.dat" 'model proca
$crystal = 1000000 'taktowanie
Dim Cyfra As Integer
Dim Her As Byte
Declare Sub Wyswietl
Declare Sub Pokaz
Dim A As Byte
Config Portb = Output 'port b jako wyjścia
Portb = &B00000000 'stan spoczynkowy-0
Config Portd = Output 'pprt d jako wyjścia
Portd = &B0000000 'stan spoczynkowy-0
'2134 wyswietlacz
'5432 port
Config Timer0 = Timer , Prescale = 256
Load Timer0 , 255
On Timer0 Timer0_int
Enable Timer0
Enable Interrupts
Start Timer0
A = 0
Do
For Her = 0 To 9 Step 1
Pokaz
Wait 3
Next Her
A = A + 1
Loop
Sub Pokaz
Timer0_int:
Load Timer0 , 255
Cyfra = Her
Gosub Wyswietl
Set Portd.2
Waitms 4
Reset Portd.2
Cyfra = A
Gosub Wyswietl
Set Portd.3
Waitms 4
Reset Portd.3
Return
End Sub
Sub Wyswietl:
Portb = Lookup(cyfra , Liczby )
End Sub
Liczby:
Data &B00001001 , &B01101111 , &B01011000 , &B01001010 , &B00101110 , &B10001010 , &B10001000 , &B01001111 , &B00001000 , &B00001010
' 0, 1 ,2 , 3 , 4 , 5 , 6 , 7, 8, 9
'koniec programu