Ich habe es mir auch gekauft aufgebaut und bin sehr zuvrieden damit. ich betreibe es mit einem Atmega32. Die Led habe ich schon zum laufen gebraucht aber wie regele ich das mit den schaltern? mein programm :
Code:
$regfile = "m32def.dat" ' Prozessortyp ATmega8
$crystal = 8000000 ' Taktrate
Dim Mybyte As Byte ' ein Byte als Variable
Dim I As Byte
Ddrd = &B11100000 ' PD5-PD7 auf Ausgang
Portd = &B00000000 ' alle LEDs off
Config Portd.4 = Input
I = 0
Mybyte = 1 ' Startwert &B00000001
If I = 1 Then Loop
End If
Do ' Beginn Mainloop
Portd = Mybyte ' Ausgabe
Waitms 100 ' Warte kurz
Rotate Mybyte , Left ' Bit laufen lassen (Rotation)
If Portd.4 = 1 Then I = 1
End If
Loop
End
Lesezeichen