Witam,
moj projekt jest dosc prosty, 15 ledow i przycisk, ktorym sterujemy zmianami kombinacji mrugania diod. napisalem program w bascomie, ale nie jestem pewny czy mozna w ten sposob napisac obsluge przycisku, wiec prosze o pomoc, na pewno poprawienie bledow nie zajmie dlugo. program jest troche przydlugawy, ale glownie chodzi mi w nim o zapalanie diod, wiec dlatego tak wyglada. nie uzywalem zbyt czesto bascoma, wiec nie wiem czy mozna to jakos skrocic
chcialem jeszcze dodac, ze nie moge go na razie przetestowac z powodow ode mnie nie zaleznych, dlatego prosze o pomoc, pozdrawiam
moj projekt jest dosc prosty, 15 ledow i przycisk, ktorym sterujemy zmianami kombinacji mrugania diod. napisalem program w bascomie, ale nie jestem pewny czy mozna w ten sposob napisac obsluge przycisku, wiec prosze o pomoc, na pewno poprawienie bledow nie zajmie dlugo. program jest troche przydlugawy, ale glownie chodzi mi w nim o zapalanie diod, wiec dlatego tak wyglada. nie uzywalem zbyt czesto bascoma, wiec nie wiem czy mozna to jakos skrocic
$regfile "m8def.dat"
$crystal = 1000000
Config Portb = Output
Config Portc = Output
Config Portd = Output
Config Pind.0 = Input 'przycisk
Config Pind.1 = Input 'przycisk
S1 Alias Pind.0
S2 Alias Pind.1
Set Portd.0
Set Portd.1
Dim A As Byte
A = 1
If S1 = 0 And S2 = 0 Then 'zwiekszenie zmiennej zliczajacej
A = A + 1
For A = 1 To 3
Do
If A = 1 Then
Portb.0 = 1
Waitms 250
Portb.0 = 0
Waitms 250
Portb.1 = 1
Waitms 250
Portb.1 = 0
Waitms 250
Portb.2 = 1
Waitms 250
Portb.2 = 0
Waitms 250
Portb.3 = 1
Waitms 250
Portb.3 = 0
Waitms 250
Portb.4 = 1
Waitms 250
Portb.4 = 0
Waitms 250
Portb.5 = 1
Waitms 250
Portb.5 = 0
Waitms 250
Portc.0 = 1
Waitms 250
Portc.0 = 0
Waitms 250
Portc.1 = 1
Waitms 250
Portc.1 = 0
Waitms 250
Portc.2 = 1
Waitms 250
Portc.2 = 0
Waitms 250
Portc.3 = 1
Waitms 250
Portc.3 = 0
Waitms 250
Portc.4 = 1
Waitms 250
Portc.4 = 0
Waitms 250
Portc.5 = 1
Waitms 250
Portc.5 = 0
Waitms 250
Portd.4 = 1
Waitms 250
Portd.4 = 0
Waitms 250
Portd.3 = 1
Waitms 250
Portd.3 = 0
Waitms 250
Portd.2 = 1
Waitms 250
Portd.2 = 0
Waitms 250
End If
Next A
Loop
Do
If A = 2 Then
Portc.1 = 1
Waitms 250
Portc.0 = 1
Portc.2 = 1
Waitms 250
Portb.5 = 1
Portc.3 = 1
Waitms 250
Portb.4 = 1
Portc.4 = 1
Waitms 250
Portb.3 = 1
Portc.5 = 1
Waitms 250
Portb.2 = 1
Portd.4 = 1
Waitms 250
Portb.1 = 1
Portd.3 = 1
Waitms 250
Portb.0 = 1
Portc.2 = 1
Waitms 250
Portb = 0
Portc = 0
Portd = 0
End If
Next A
Loop
If A = 3 Then
A = 1
End Ifchcialem jeszcze dodac, ze nie moge go na razie przetestowac z powodow ode mnie nie zaleznych, dlatego prosze o pomoc, pozdrawiam