Witam wszystkich serdecznie !
Z racji tego, że zbliżają się święta postanowiłem podzielić się z wami projektem elektronicznego drzewka szczęścia. Urządzenie powstało prawie rok temu i było prezentem urodzinowym dla mojej dziewczyny którą serdecznie pozdrawiam !!!
Założenia do projektu:
- Zasilanie 230V
- Częściowo otwarta obudowa
- 21 LED RGB
- Sterowanie za pomocą enkodera
- Rozjaśnienie szarych zimowych wieczorów
Elementy użyte w projekcie:
- Laminat
- Transformator (10,5V / 0,5A) x 1
- Gniazdo zasilania ósemkowe x 1
- Wyłącznik okrągły podświetlany AC x 1
- Enkoder z przyciskiem x 1
- LED pomarańczowa x 5
- LED RGB (mleczna, wsp anoda) x 21
- AtMega16 x 1
- ULN2004 x 3
- LM7805 x 1
- Mostek prostowniczy W02M x 1
- Rezonator kwarcowy 10MHz x 1
- Tranzystor BC558 x 1
- Rezystory
- Kondensatory
- Drut lakierowany (ok. 2m)
- Przewody
Opis:
Drzewko zostało skręcone z drutu lakierowanego (z odzysku, średnica (chyba) 0,8mm) i każde końcówki drutu zostały oskrobane z lakieru i zaopatrzone w diodę LED RGB. Diody LED RGB tworzą matrycę wyświetlacza 3x7 i całość jest multipleksowana. Obudowa została zaprojektowana od podstaw tak aby prezentowała swoje wnętrze. Na zdjęciach poniżej widać, że na płytkach które tworzą obudowę zostały wytrawione wzory, które miały być częścią dekoracji. Niestety coś mnie pokusiło żeby je ocynować i to był duży błąd który popsuł cały wygląd... Wybór uC padł na AtMegę16 ponieważ, posiada ona dostateczną liczbę wyprowadzeń by móc sterować całym urządzeniem. Diody LED 1 - 5 na schemacie przedstawionym poniżej, realizują funkcję informacyjną wyświetlanej aktualnie animacji. Tranzystory T1, T2, T3 i układy IC2, IC3, IC4 odpowiedzialne są za wysterowanie matrycy. Opis reszty pozwolę sobie pominąć. Wewnątrz obudowy znajduje się transformator który częściowo wystaje za obrys płytki sterującej dlatego konieczne było wycięcie otworu. Przejdźmy teraz do programu, który został napisany w języku BASCOM. W programie zostały zawarte instrukcje do generowana 6 animacji które są wybierane za pomocą przycisku enkodera, a obracanie enkodera przełącza kolory świecenia w danej animacji. Niestety nie mogę podać dokładnego kosztorysu z racji tego, że już nie pamiętam. Całość została ozdobiona co poprawiło wygląd całości
Gorąco zachęcam do obejrzenia filmu przedstawiającego w skrócie cały proces powstawania projektu ! Zapraszam do komentowania i przedstawiania swoich uwag.
Pozdrawiam !!!
Schemat i płytka główna:
Zdjęcia dodatkowe:
Film:
Program:
Spoiler:
$regfile = "m16def.dat"
$crystal = 1000000
Config Porta = &B11111111 'diody zielone
Porta = &B00000000 '7-6-5-4-3-2-1
Config Portb = &B11111111 'diody niebieskie
Portb = &B00000000
Config Portc = &B11111111 'diody czerwone
Portc = &B00000000
Config Portd = &B11100011
Portd = &B11111100
Config Timer0 = Timer , Prescale = 1 'Crystal 1MHz
'Config Timer0 = Timer , Prescale = 64 'Crystal 10MHz
Declare Sub Pobr_znaku(cyfra As Byte)
Dim Nr_przerwania As Byte : Nr_przerwania = 0 'Zmienna numeru przerwania
Dim Licz As Byte : Licz = 0 'Zmienna licz do określenia powtórzeń przerwań TIM_0
Dim A As Byte : A = 0 'Zmienna pomocnicza do obsługi 1 kolumny
Dim B As Byte : B = 0 'Zmienna pomocnicza do obsługi 2 kolumny
Dim C As Byte : C = 0 'Zmienna pomocnicza do obsługi 3 kolumny
Dim D As Byte : D = 0 'Zmienna pomocnicza do wyboru kolorów
Dim E As Bit : E = 1 'Zmienna pomocnicza do obsługi enkodera
Dim F As Byte : F = 1 '
Dim G As Byte : G = 0
Dim H As Byte : H = 0
Dim T As Word : T = 0 'Xmienna pomocnicza do odmierzania czasu
Dim Program As Byte : Program = 0 'Zmienna do określenia nr programu animacji
Dim Pwm As Byte : Pwm = 0 'Zmienna do określenia sygnału PWM
Dim Led1 As Bit 'Zmienna pomocnicza do obsługi Led 1
Dim Led2 As Bit 'Zmienna pomocnicza do obsługi Led 2
Dim Led3 As Bit 'Zmienna pomocnicza do obsługi Led 3
Dim Led4 As Bit 'Zmienna pomocnicza do obsługi Led 4
Dim Led5 As Bit 'Zmienna pomocnicza do obsługi Led 5
K1 Alias Portd.5 'Zmiania nazwy PD.5 na Kolumna 1
K2 Alias Portd.6 'Zmiania nazwy PD.6 na Kolumna 2
K3 Alias Portd.7 'Zmiania nazwy PD.7 na Kolumna 3
Led_1 Alias Portb.0 'Zmiania nazwy PB.0 na Led 1
Led_2 Alias Porta.0 'Zmiania nazwy PA.0 na Led 2
Led_3 Alias Portd.0 'Zmiania nazwy PD.0 na Led 3
Led_4 Alias Portd.1 'Zmiania nazwy PD.1 na Led 4
Led_5 Alias Portc.7 'Zmiania nazwy PC.7 na Led 5
Switch Alias Pind.4 'Zmiania nazwy PD.4 na Switch
Int_1 Alias Pind.3 'Zmiania nazwy PD.3 na Int_1
Int_0 Alias Pind.2 'Zmiania nazwy PD.2 na Int_0
On Int0 Enkoder 'Aktywacja etykiety do której nastąpi skok po przerwaniu INT0
On Timer0 Multiplex 'Aktywacja etykiety do której nastąpi skok po przerwaniu TIMER0
Enable Interrupts 'Aktywacja przerwań
Enable Timer0 'Aktywacja TIMER0
Enable Int0 'Aktywacja INT0
Load Timer0 , 256 'Załadowanie do TIMER0 Wartości 256
'------------------------------------- WSTĘP -----------------------------------
Do
While F < 9
Select Case F
Case 1:
A = 11 : B = 11 : C = 11 : D = 0 'Zielony
Case 2:
A = 12 : B = 12 : C = 12 : D = 5 'Fioletowy
Case 3:
A = 9 : B = 9 : C = 9 : D = 3 'Żółty
Case 4:
A = 10 : B = 10 : C = 10 : D = 6 'Biały
Case 5:
A = 13 : B = 13 : C = 13 : D = 4 'Błękitny
Case 6:
A = 8 : B = 8 : C = 8 : D = 1 'Niebieski
Case 7:
A = 1 : B = 1 : C = 1 : D = 2 'Czerwony
Case 8
A = 14 : B = 14 : C = 14 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
If F = 8 Then
Waitms 1
Else
Waitus 150
End If
Else
Pwm = 0
End If
Wend
If F < 8 Then
While Pwm <> 0
Decr Pwm
Waitus 150
Wend
Incr F
Else
Pwm = 40
Exit While
End If
Wend
A = 17 : B = 17 : C = 17 : D = 6
Waitms 5
A = 18 : B = 18 : C = 18 : D = 6
Waitms 5
A = 19 : B = 19 : C = 19 : D = 6
Waitms 5
A = 20 : B = 20 : C = 20 : D = 6
Waitms 5
A = 21 : B = 21 : C = 21 : D = 6
Waitms 5
A = 22 : B = 22 : C = 22 : D = 6
Waitms 5
While Pwm <> 0
Decr Pwm
Waitms 1
Wend
F = 1
Pwm = 0
Waitms 200
Exit Do
Loop
'-------------------------------- PROGRAM GŁÓWNY -------------------------------
Do
Start Timer0
Select Case Program
Case 0:
Set Led1 : Reset Led2 : Reset Led3 : Reset Led4 : Reset Led5
Pwm = 50
Select Case F 'Świecenie ciągłe
Case 1:
A = 7 : B = 7 : C = 7 : D = 0
Case 2:
A = 7 : B = 7 : C = 7 : D = 1
Case 3:
A = 7 : B = 7 : C = 7 : D = 2
Case 4:
A = 7 : B = 7 : C = 7 : D = 3
Case 5:
A = 7 : B = 7 : C = 7 : D = 4
Case 6:
A = 7 : B = 7 : C = 7 : D = 5
Case 7:
A = 7 : B = 7 : C = 7 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
G = 0
Incr Program
End If
Case 1:
Reset Led1 : Set Led2 : Reset Led3 : Reset Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
A = 7 : B = 7 : C = 7 : D = 0
Case 2:
A = 7 : B = 7 : C = 7 : D = 1
Case 3:
A = 7 : B = 7 : C = 7 : D = 2
Case 4:
A = 7 : B = 7 : C = 7 : D = 3
Case 5:
A = 7 : B = 7 : C = 7 : D = 4
Case 6:
A = 7 : B = 7 : C = 7 : D = 5
Case 7:
A = 7 : B = 7 : C = 7 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
If Program = 1 Then
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
End If
Case 2:
Pwm = 0
Reset Led1 : Reset Led2 : Set Led3 : Reset Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 0
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 0
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
Case 2:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 1
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 1
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
Case 3:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 2
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 2
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
Case 4:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 3
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 3
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
Case 5:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 4
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 4
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
Case 6:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 5
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 5
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
Case 7:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 6
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 6
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 1
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 40
Incr Program
Exit While
End If
Wend
While Pwm <> 0
Decr Pwm
Waitms 1
If Switch = 0 Then
Waitms 40
Incr Program
Exit While
End If
Wend
Incr G
If F = 0 Then
F = 1
End If
If F = 8 Then
F = 7
End If
If G = 4 Then
G = 0
End If
Case 3:
Pwm = 49
Reset Led1 : Reset Led2 : Reset Led3 : Set Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
A = 14 : B = 14 : C = 14 : D = 6
Case 2:
A = 17 : B = 17 : C = 17 : D = 6
Case 3:
A = 18 : B = 18 : C = 18 : D = 6
Case 4:
A = 19 : B = 19 : C = 19 : D = 6
Case 5:
A = 20 : B = 20 : C = 20 : D = 6
Case 6:
A = 21 : B = 21 : C = 21 : D = 6
Case 7:
A = 22 : B = 22 : C = 22 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 4:
Pwm = 49
Reset Led1 : Reset Led2 : Reset Led3 : Reset Led4 : Set Led5
A = A + 1 : B = B + 3 : C = C + 2
Waitus 700
Select Case F
Case 1:
D = 3
Case 2:
D = 4
Case 3:
D = 5
Case 4:
D = 6
End Select
If A > 22 Then
A = 1
End If
If B > 22 Then
B = 1
End If
If C > 22 Then
C = 1
End If
If F > 4 Then
F = 4
End If
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 5:
Pwm = 0
Set Led1 : Set Led2 : Set Led3 : Set Led4 : Set Led5
Select Case F 'Świecenie ciągłe
Case 1:
If T > 200 Then
Incr G
T = 0
End If
Select Case G
Case 0:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 0
Case 1:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 1
Case 2:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 2
Case 3:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 3
Case 4:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 4
Case 5:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 5
Case 6:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 2:
Select Case G 'Świecenie pulsujące
Case 0:
A = 7 : B = 7 : C = 7 : D = 0
Case 1:
A = 7 : B = 7 : C = 7 : D = 1
Case 2:
A = 7 : B = 7 : C = 7 : D = 2
Case 3:
A = 7 : B = 7 : C = 7 : D = 3
Case 4:
A = 7 : B = 7 : C = 7 : D = 4
Case 5:
A = 7 : B = 7 : C = 7 : D = 5
Case 6:
A = 7 : B = 7 : C = 7 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr G
If G = 7 Then
G = 0
End If
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Case 3:
Select Case G 'Świecenie pulsujące
Case 0:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 0
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 0
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
Case 1:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 1
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 1
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
Case 2:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 2
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 2
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
Case 3:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 3
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 3
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
Case 4:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 4
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 4
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
Case 5:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 5
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 5
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
Case 6:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 6
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 6
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
End Select
While Pwm <> 40
If Pwm < 40 Then
Incr Pwm
Waitms 1
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
While Pwm <> 0
Decr Pwm
Waitms 1
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr H
' If H = 4 Then
' H = 0
' Incr G
' End If
' If G = 8 Then
' G = 1
' End If
Case 4:
Select Case G
Case 1:
A = 14 : B = 14 : C = 14 : D = 6
Case 2:
A = 17 : B = 17 : C = 17 : D = 6
Case 3:
A = 18 : B = 18 : C = 18 : D = 6
Case 4:
A = 19 : B = 19 : C = 19 : D = 6
Case 5:
A = 20 : B = 20 : C = 20 : D = 6
Case 6:
A = 21 : B = 21 : C = 21 : D = 6
Case 7:
A = 22 : B = 22 : C = 22 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr G
If G = 7 Then
G = 0
End If
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Case 5:
Pwm = 49
A = A + 1 : B = B + 3 : C = C + 2
Waitus 200
Set Led1 : Set Led2 : Set Led3 : Set Led4 : Set Led5
If T > 1000 Then
Incr D
T = 0
End If
' Waitus 200
If A > 22 Then
A = 1
End If
If B > 22 Then
B = 1
End If
If C > 22 Then
C = 1
End If
If Switch = 0 Then
Pwm = 0
Waitms 10
F = 1
G = 0
Incr Program
End If
End Select
If F > 5 Then
F = 5
End If
If F = 0 Then
F = 1
End If
If G = 7 Then
G = 0
H = 0
End If
If H = 4 Then
H = 0
Incr G
End If
End Select
If F > 8 Then
F = 8
End If
If F = 0 Then
F = 1
End If
If Program = 6 Then
Program = 0
End If
Enable Int0
Loop
End
Enkoder:
E = 1
Disable Int0
Stop Timer0
Porta = 0
Portb = 0
Portc = 0
Pwm = 0
If Int_1 = 1 Then
Waitms 50
While E = 1
If Int_1 = 1 Then
If Int_0 = 1 Then
Incr F
E = 0
Waitms 30
Else
E = 0
Waitms 30
End If
End If
Wend
End If
If Int_1 = 0 Then
Waitms 50
While E = 1
If Int_1 = 1 Then
If Int_0 = 1 Then
Decr F
E = 0
Waitms 30
Else
E = 0
Waitms 30
End If
End If
Wend
End If
Return
Sub Pobr_znaku(cyfra As Byte)
If D = 0 Then 'ZIELONY
Porta = Lookup(cyfra , Kod_g)
Portb = 0
Portc = 0
End If
If D = 1 Then 'NIEBIESKI
Porta = 0
Portb = Lookup(cyfra , Kod_b)
Portc = 0
End If
If D = 2 Then 'CZERWONY
Porta = 0
Portb = 0
Portc = Lookup(cyfra , Kod_cz)
End If
If D = 3 Then 'ZOLTY
Porta = Lookup(cyfra , Kod_g)
Portb = 0
Portc = Lookup(cyfra , Kod_cz)
End If 'BLEKITNY
If D = 4 Then
Porta = Lookup(cyfra , Kod_g)
Portb = Lookup(cyfra , Kod_b)
Portc = 0
End If 'FIOLETOWY
If D = 5 Then
Porta = 0
Portb = Lookup(cyfra , Kod_b)
Portc = Lookup(cyfra , Kod_cz)
End If 'BIALY
If D = 6 Then
Porta = Lookup(cyfra , Kod_g)
Portb = Lookup(cyfra , Kod_b)
Portc = Lookup(cyfra , Kod_cz)
End If
If D = 7 Then
D = 0
End If
End Sub
Multiplex:
Load Timer0 , 256
Incr Licz
'
If Licz < 50 Then
Set K1
Set K2
Set K3
Select Case Nr_przerwania
Case 0:
If Licz <= Pwm Then
Call Pobr_znaku(a)
Reset K1
Else
Set K1
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
Case 1:
If Licz <= Pwm Then
Call Pobr_znaku(b)
Reset K2
Else
Set K2
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
Case 2:
If Licz <= Pwm Then
Call Pobr_znaku(c)
Reset K3
Else
Set K3
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
End Select
Incr Nr_przerwania
Incr Licz
If Nr_przerwania = 3 Then
Nr_przerwania = 0
End If
End If
If Licz = 50 Then
Licz = 0
Incr T
End If
Return
Kod_g:
Data &B00000000 , &B00000010 , &B00000110 , &B00001110 , &B00011110, '0(NOT) - 1 - 2 - 3 - 4
Data &B00111110 , &B01111110 , &B11111110 , &B00000100 , &B00001000, '5 - 6 - 7 - 8 - 9
Data &B00010000 , &B00100000 , &B01000000 , &B10000000 , &B10111000, '10 - 11 - 12 - 13 - 14
Data &B11110000 , &B00001100 , &B01011100 , &B00101110 , &B10010110 '15 - 16 - 17 - 18 - 19
Data &B11001010 , &B11100100 , &B01110010 '20 - 21 - 22
Kod_b:
Data &B00000000 , &B00000010 , &B00000110 , &B00001110 , &B00011110, '0 - 1 - 2 - 3 - 4
Data &B00111110 , &B01111110 , &B11111110 , &B00000100 , &B00001000, '5 - 6 - 7 - 8 - 9
Data &B00010000 , &B00100000 , &B01000000 , &B10000000 , &B11010100, '10 - 11 - 12 - 13 - 14
Data &B11110000 , &B00001100 , &B01101010 , &B10110100 , &B01011010 '15 - 16 - 17 - 18 - 19
Data &B10101100 , &B01010110 , &B10101010 '20 - 21 - 22
Kod_cz:
Data &B00000000 , &B00000001 , &B00000011 , &B00000111 , &B00001111, '0 - 1 - 2 - 3 - 4
Data &B00011111 , &B00111111 , &B01111111 , &B00000010 , &B00000100, '5 - 6 - 7 - 8 - 9
Data &B00001000 , &B00010000 , &B00100000 , &B01000000 , &B00101101, '10 - 11 - 12 - 13 - 14
Data &B01111000 , &B00000110 , &B01010110 , &B00101011 , &B01010101 '15 - 16 - 17 - 18 - 19
Data &B01101010 , &B00110101 , &B01011010 '20 - 21 - 22
' (14) 1 - Czerwony, 2 - Niebieski, 3 - Żółty, 4 - Biały, 5 - Zielony, 6 - Fioletowy, 7 - Błękitny
' (17) 1 - Niebieski, 2 - Żółty, 3 - Biały, 4 - Zielony, 5 - Fioletowy, 6 - Błękitny, 7 - Czerwony
' (18) 1 - Żółty, 2 - Biały, 3 - Zielony, 4 - Fioletowy, 5 - Błękitny, 6 - Czerwony, 7 - Niebieski
' (19) 1 - Biały, 2 - Zielony, 3 - Fioletowy, 4 - Błękitny, 5 - Czerwony, 6 - Niebieski, 7 - Żółty
' (20) 1 - Zielony, 2 - Fioletowy, 3 - Błękitny, 4 - Czerwony, 5 - Niebieski, 6 - Żółty, 7 - Biały
' (21) 1 - Fioletowy, 2 - Błękitny, 3 - Czerwony, 4 - Niebieski, 5 - Żółty, 6 - Biały, 7 - Zielony
' (22) 1 - Błękitny, 2 - Czerwony, 3 - Niebieski, 4 - Żółty, 5 - Biały, 6 - Zielony, 7 - Fioletowy
$crystal = 1000000
Config Porta = &B11111111 'diody zielone
Porta = &B00000000 '7-6-5-4-3-2-1
Config Portb = &B11111111 'diody niebieskie
Portb = &B00000000
Config Portc = &B11111111 'diody czerwone
Portc = &B00000000
Config Portd = &B11100011
Portd = &B11111100
Config Timer0 = Timer , Prescale = 1 'Crystal 1MHz
'Config Timer0 = Timer , Prescale = 64 'Crystal 10MHz
Declare Sub Pobr_znaku(cyfra As Byte)
Dim Nr_przerwania As Byte : Nr_przerwania = 0 'Zmienna numeru przerwania
Dim Licz As Byte : Licz = 0 'Zmienna licz do określenia powtórzeń przerwań TIM_0
Dim A As Byte : A = 0 'Zmienna pomocnicza do obsługi 1 kolumny
Dim B As Byte : B = 0 'Zmienna pomocnicza do obsługi 2 kolumny
Dim C As Byte : C = 0 'Zmienna pomocnicza do obsługi 3 kolumny
Dim D As Byte : D = 0 'Zmienna pomocnicza do wyboru kolorów
Dim E As Bit : E = 1 'Zmienna pomocnicza do obsługi enkodera
Dim F As Byte : F = 1 '
Dim G As Byte : G = 0
Dim H As Byte : H = 0
Dim T As Word : T = 0 'Xmienna pomocnicza do odmierzania czasu
Dim Program As Byte : Program = 0 'Zmienna do określenia nr programu animacji
Dim Pwm As Byte : Pwm = 0 'Zmienna do określenia sygnału PWM
Dim Led1 As Bit 'Zmienna pomocnicza do obsługi Led 1
Dim Led2 As Bit 'Zmienna pomocnicza do obsługi Led 2
Dim Led3 As Bit 'Zmienna pomocnicza do obsługi Led 3
Dim Led4 As Bit 'Zmienna pomocnicza do obsługi Led 4
Dim Led5 As Bit 'Zmienna pomocnicza do obsługi Led 5
K1 Alias Portd.5 'Zmiania nazwy PD.5 na Kolumna 1
K2 Alias Portd.6 'Zmiania nazwy PD.6 na Kolumna 2
K3 Alias Portd.7 'Zmiania nazwy PD.7 na Kolumna 3
Led_1 Alias Portb.0 'Zmiania nazwy PB.0 na Led 1
Led_2 Alias Porta.0 'Zmiania nazwy PA.0 na Led 2
Led_3 Alias Portd.0 'Zmiania nazwy PD.0 na Led 3
Led_4 Alias Portd.1 'Zmiania nazwy PD.1 na Led 4
Led_5 Alias Portc.7 'Zmiania nazwy PC.7 na Led 5
Switch Alias Pind.4 'Zmiania nazwy PD.4 na Switch
Int_1 Alias Pind.3 'Zmiania nazwy PD.3 na Int_1
Int_0 Alias Pind.2 'Zmiania nazwy PD.2 na Int_0
On Int0 Enkoder 'Aktywacja etykiety do której nastąpi skok po przerwaniu INT0
On Timer0 Multiplex 'Aktywacja etykiety do której nastąpi skok po przerwaniu TIMER0
Enable Interrupts 'Aktywacja przerwań
Enable Timer0 'Aktywacja TIMER0
Enable Int0 'Aktywacja INT0
Load Timer0 , 256 'Załadowanie do TIMER0 Wartości 256
'------------------------------------- WSTĘP -----------------------------------
Do
While F < 9
Select Case F
Case 1:
A = 11 : B = 11 : C = 11 : D = 0 'Zielony
Case 2:
A = 12 : B = 12 : C = 12 : D = 5 'Fioletowy
Case 3:
A = 9 : B = 9 : C = 9 : D = 3 'Żółty
Case 4:
A = 10 : B = 10 : C = 10 : D = 6 'Biały
Case 5:
A = 13 : B = 13 : C = 13 : D = 4 'Błękitny
Case 6:
A = 8 : B = 8 : C = 8 : D = 1 'Niebieski
Case 7:
A = 1 : B = 1 : C = 1 : D = 2 'Czerwony
Case 8
A = 14 : B = 14 : C = 14 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
If F = 8 Then
Waitms 1
Else
Waitus 150
End If
Else
Pwm = 0
End If
Wend
If F < 8 Then
While Pwm <> 0
Decr Pwm
Waitus 150
Wend
Incr F
Else
Pwm = 40
Exit While
End If
Wend
A = 17 : B = 17 : C = 17 : D = 6
Waitms 5
A = 18 : B = 18 : C = 18 : D = 6
Waitms 5
A = 19 : B = 19 : C = 19 : D = 6
Waitms 5
A = 20 : B = 20 : C = 20 : D = 6
Waitms 5
A = 21 : B = 21 : C = 21 : D = 6
Waitms 5
A = 22 : B = 22 : C = 22 : D = 6
Waitms 5
While Pwm <> 0
Decr Pwm
Waitms 1
Wend
F = 1
Pwm = 0
Waitms 200
Exit Do
Loop
'-------------------------------- PROGRAM GŁÓWNY -------------------------------
Do
Start Timer0
Select Case Program
Case 0:
Set Led1 : Reset Led2 : Reset Led3 : Reset Led4 : Reset Led5
Pwm = 50
Select Case F 'Świecenie ciągłe
Case 1:
A = 7 : B = 7 : C = 7 : D = 0
Case 2:
A = 7 : B = 7 : C = 7 : D = 1
Case 3:
A = 7 : B = 7 : C = 7 : D = 2
Case 4:
A = 7 : B = 7 : C = 7 : D = 3
Case 5:
A = 7 : B = 7 : C = 7 : D = 4
Case 6:
A = 7 : B = 7 : C = 7 : D = 5
Case 7:
A = 7 : B = 7 : C = 7 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
G = 0
Incr Program
End If
Case 1:
Reset Led1 : Set Led2 : Reset Led3 : Reset Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
A = 7 : B = 7 : C = 7 : D = 0
Case 2:
A = 7 : B = 7 : C = 7 : D = 1
Case 3:
A = 7 : B = 7 : C = 7 : D = 2
Case 4:
A = 7 : B = 7 : C = 7 : D = 3
Case 5:
A = 7 : B = 7 : C = 7 : D = 4
Case 6:
A = 7 : B = 7 : C = 7 : D = 5
Case 7:
A = 7 : B = 7 : C = 7 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
If Program = 1 Then
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
End If
Case 2:
Pwm = 0
Reset Led1 : Reset Led2 : Set Led3 : Reset Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 0
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 0
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
Case 2:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 1
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 1
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
Case 3:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 2
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 2
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
Case 4:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 3
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 3
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
Case 5:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 4
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 4
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
Case 6:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 5
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 5
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
Case 7:
If G = 0 Then
A = 15 : B = 15 : C = 15 : D = 6
End If
If G = 1 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
If G = 2 Then
A = 1 : B = 1 : C = 1 : D = 6
End If
If G = 3 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 1
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 40
Incr Program
Exit While
End If
Wend
While Pwm <> 0
Decr Pwm
Waitms 1
If Switch = 0 Then
Waitms 40
Incr Program
Exit While
End If
Wend
Incr G
If F = 0 Then
F = 1
End If
If F = 8 Then
F = 7
End If
If G = 4 Then
G = 0
End If
Case 3:
Pwm = 49
Reset Led1 : Reset Led2 : Reset Led3 : Set Led4 : Reset Led5
Select Case F 'Świecenie pulsujące
Case 1:
A = 14 : B = 14 : C = 14 : D = 6
Case 2:
A = 17 : B = 17 : C = 17 : D = 6
Case 3:
A = 18 : B = 18 : C = 18 : D = 6
Case 4:
A = 19 : B = 19 : C = 19 : D = 6
Case 5:
A = 20 : B = 20 : C = 20 : D = 6
Case 6:
A = 21 : B = 21 : C = 21 : D = 6
Case 7:
A = 22 : B = 22 : C = 22 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 4:
Pwm = 49
Reset Led1 : Reset Led2 : Reset Led3 : Reset Led4 : Set Led5
A = A + 1 : B = B + 3 : C = C + 2
Waitus 700
Select Case F
Case 1:
D = 3
Case 2:
D = 4
Case 3:
D = 5
Case 4:
D = 6
End Select
If A > 22 Then
A = 1
End If
If B > 22 Then
B = 1
End If
If C > 22 Then
C = 1
End If
If F > 4 Then
F = 4
End If
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 5:
Pwm = 0
Set Led1 : Set Led2 : Set Led3 : Set Led4 : Set Led5
Select Case F 'Świecenie ciągłe
Case 1:
If T > 200 Then
Incr G
T = 0
End If
Select Case G
Case 0:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 0
Case 1:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 1
Case 2:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 2
Case 3:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 3
Case 4:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 4
Case 5:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 5
Case 6:
Pwm = 49 : A = 7 : B = 7 : C = 7 : D = 6
End Select
If Switch = 0 Then
Waitms 3
Pwm = 0
F = 1
G = 0
Incr Program
End If
Case 2:
Select Case G 'Świecenie pulsujące
Case 0:
A = 7 : B = 7 : C = 7 : D = 0
Case 1:
A = 7 : B = 7 : C = 7 : D = 1
Case 2:
A = 7 : B = 7 : C = 7 : D = 2
Case 3:
A = 7 : B = 7 : C = 7 : D = 3
Case 4:
A = 7 : B = 7 : C = 7 : D = 4
Case 5:
A = 7 : B = 7 : C = 7 : D = 5
Case 6:
A = 7 : B = 7 : C = 7 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr G
If G = 7 Then
G = 0
End If
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Case 3:
Select Case G 'Świecenie pulsujące
Case 0:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 0
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 0
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 0
End If
Case 1:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 1
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 1
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 1
End If
Case 2:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 2
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 2
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 2
End If
Case 3:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 3
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 3
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 3
End If
Case 4:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 4
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 4
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 4
End If
Case 5:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 5
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 5
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 5
End If
Case 6:
If H = 0 Then
A = 15 : B = 15 : C = 15 : D = 6
End If
If H = 1 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
If H = 2 Then
A = 1 : B = 1 : C = 1 : D = 6
End If
If H = 3 Then
A = 16 : B = 16 : C = 16 : D = 6
End If
End Select
While Pwm <> 40
If Pwm < 40 Then
Incr Pwm
Waitms 1
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
While Pwm <> 0
Decr Pwm
Waitms 1
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr H
' If H = 4 Then
' H = 0
' Incr G
' End If
' If G = 8 Then
' G = 1
' End If
Case 4:
Select Case G
Case 1:
A = 14 : B = 14 : C = 14 : D = 6
Case 2:
A = 17 : B = 17 : C = 17 : D = 6
Case 3:
A = 18 : B = 18 : C = 18 : D = 6
Case 4:
A = 19 : B = 19 : C = 19 : D = 6
Case 5:
A = 20 : B = 20 : C = 20 : D = 6
Case 6:
A = 21 : B = 21 : C = 21 : D = 6
Case 7:
A = 22 : B = 22 : C = 22 : D = 6
End Select
While Pwm <> 39
If Pwm < 40 Then
Incr Pwm
Waitms 10
Else
Pwm = 0
End If
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Incr G
If G = 7 Then
G = 0
End If
While Pwm <> 0
Decr Pwm
Waitms 10
If Switch = 0 Then
Waitms 50
Incr Program
Exit While
End If
Wend
Case 5:
Pwm = 49
A = A + 1 : B = B + 3 : C = C + 2
Waitus 200
Set Led1 : Set Led2 : Set Led3 : Set Led4 : Set Led5
If T > 1000 Then
Incr D
T = 0
End If
' Waitus 200
If A > 22 Then
A = 1
End If
If B > 22 Then
B = 1
End If
If C > 22 Then
C = 1
End If
If Switch = 0 Then
Pwm = 0
Waitms 10
F = 1
G = 0
Incr Program
End If
End Select
If F > 5 Then
F = 5
End If
If F = 0 Then
F = 1
End If
If G = 7 Then
G = 0
H = 0
End If
If H = 4 Then
H = 0
Incr G
End If
End Select
If F > 8 Then
F = 8
End If
If F = 0 Then
F = 1
End If
If Program = 6 Then
Program = 0
End If
Enable Int0
Loop
End
Enkoder:
E = 1
Disable Int0
Stop Timer0
Porta = 0
Portb = 0
Portc = 0
Pwm = 0
If Int_1 = 1 Then
Waitms 50
While E = 1
If Int_1 = 1 Then
If Int_0 = 1 Then
Incr F
E = 0
Waitms 30
Else
E = 0
Waitms 30
End If
End If
Wend
End If
If Int_1 = 0 Then
Waitms 50
While E = 1
If Int_1 = 1 Then
If Int_0 = 1 Then
Decr F
E = 0
Waitms 30
Else
E = 0
Waitms 30
End If
End If
Wend
End If
Return
Sub Pobr_znaku(cyfra As Byte)
If D = 0 Then 'ZIELONY
Porta = Lookup(cyfra , Kod_g)
Portb = 0
Portc = 0
End If
If D = 1 Then 'NIEBIESKI
Porta = 0
Portb = Lookup(cyfra , Kod_b)
Portc = 0
End If
If D = 2 Then 'CZERWONY
Porta = 0
Portb = 0
Portc = Lookup(cyfra , Kod_cz)
End If
If D = 3 Then 'ZOLTY
Porta = Lookup(cyfra , Kod_g)
Portb = 0
Portc = Lookup(cyfra , Kod_cz)
End If 'BLEKITNY
If D = 4 Then
Porta = Lookup(cyfra , Kod_g)
Portb = Lookup(cyfra , Kod_b)
Portc = 0
End If 'FIOLETOWY
If D = 5 Then
Porta = 0
Portb = Lookup(cyfra , Kod_b)
Portc = Lookup(cyfra , Kod_cz)
End If 'BIALY
If D = 6 Then
Porta = Lookup(cyfra , Kod_g)
Portb = Lookup(cyfra , Kod_b)
Portc = Lookup(cyfra , Kod_cz)
End If
If D = 7 Then
D = 0
End If
End Sub
Multiplex:
Load Timer0 , 256
Incr Licz
'
If Licz < 50 Then
Set K1
Set K2
Set K3
Select Case Nr_przerwania
Case 0:
If Licz <= Pwm Then
Call Pobr_znaku(a)
Reset K1
Else
Set K1
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
Case 1:
If Licz <= Pwm Then
Call Pobr_znaku(b)
Reset K2
Else
Set K2
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
Case 2:
If Licz <= Pwm Then
Call Pobr_znaku(c)
Reset K3
Else
Set K3
End If
Led_1 = Led1
Led_2 = Led2
Led_3 = Led3
Led_4 = Led4
Led_5 = Led5
End Select
Incr Nr_przerwania
Incr Licz
If Nr_przerwania = 3 Then
Nr_przerwania = 0
End If
End If
If Licz = 50 Then
Licz = 0
Incr T
End If
Return
Kod_g:
Data &B00000000 , &B00000010 , &B00000110 , &B00001110 , &B00011110, '0(NOT) - 1 - 2 - 3 - 4
Data &B00111110 , &B01111110 , &B11111110 , &B00000100 , &B00001000, '5 - 6 - 7 - 8 - 9
Data &B00010000 , &B00100000 , &B01000000 , &B10000000 , &B10111000, '10 - 11 - 12 - 13 - 14
Data &B11110000 , &B00001100 , &B01011100 , &B00101110 , &B10010110 '15 - 16 - 17 - 18 - 19
Data &B11001010 , &B11100100 , &B01110010 '20 - 21 - 22
Kod_b:
Data &B00000000 , &B00000010 , &B00000110 , &B00001110 , &B00011110, '0 - 1 - 2 - 3 - 4
Data &B00111110 , &B01111110 , &B11111110 , &B00000100 , &B00001000, '5 - 6 - 7 - 8 - 9
Data &B00010000 , &B00100000 , &B01000000 , &B10000000 , &B11010100, '10 - 11 - 12 - 13 - 14
Data &B11110000 , &B00001100 , &B01101010 , &B10110100 , &B01011010 '15 - 16 - 17 - 18 - 19
Data &B10101100 , &B01010110 , &B10101010 '20 - 21 - 22
Kod_cz:
Data &B00000000 , &B00000001 , &B00000011 , &B00000111 , &B00001111, '0 - 1 - 2 - 3 - 4
Data &B00011111 , &B00111111 , &B01111111 , &B00000010 , &B00000100, '5 - 6 - 7 - 8 - 9
Data &B00001000 , &B00010000 , &B00100000 , &B01000000 , &B00101101, '10 - 11 - 12 - 13 - 14
Data &B01111000 , &B00000110 , &B01010110 , &B00101011 , &B01010101 '15 - 16 - 17 - 18 - 19
Data &B01101010 , &B00110101 , &B01011010 '20 - 21 - 22
' (14) 1 - Czerwony, 2 - Niebieski, 3 - Żółty, 4 - Biały, 5 - Zielony, 6 - Fioletowy, 7 - Błękitny
' (17) 1 - Niebieski, 2 - Żółty, 3 - Biały, 4 - Zielony, 5 - Fioletowy, 6 - Błękitny, 7 - Czerwony
' (18) 1 - Żółty, 2 - Biały, 3 - Zielony, 4 - Fioletowy, 5 - Błękitny, 6 - Czerwony, 7 - Niebieski
' (19) 1 - Biały, 2 - Zielony, 3 - Fioletowy, 4 - Błękitny, 5 - Czerwony, 6 - Niebieski, 7 - Żółty
' (20) 1 - Zielony, 2 - Fioletowy, 3 - Błękitny, 4 - Czerwony, 5 - Niebieski, 6 - Żółty, 7 - Biały
' (21) 1 - Fioletowy, 2 - Błękitny, 3 - Czerwony, 4 - Niebieski, 5 - Żółty, 6 - Biały, 7 - Zielony
' (22) 1 - Błękitny, 2 - Czerwony, 3 - Niebieski, 4 - Żółty, 5 - Biały, 6 - Zielony, 7 - Fioletowy
Fajne? Ranking DIY