Gast
#2667520
Guten tag (; Bin gerade dabei mit VirtualBasic6 eine Leiterplatte mit 8 LED's über den paralellport anzusteuern. Nun meine Frage: wie kann ich das Programm durch Schleifen(mit 10er Potenzen) vereinfachen? Bis jetzt siehts so aus: Lauflicht links nach rechts Private Sub Command1_Click() M1: Call PortOut(&H378, 128) Pause 1 Call PortOut(&H378, 64) Pause 1 Call PortOut(&H378, 32) Pause 1 Call PortOut(&H378, 16) Pause 1 Call PortOut(&H378, 8) Pause 1 Call PortOut(&H378, 4) Pause 1 Call PortOut(&H378, 2) Pause 1 Call PortOut(&H378, 1) Pause 1 GoTo M1 End Sub Lauflicht kumulativ Private Sub Command3_Click() M1: Call PortOut(&H378, 1) Pause 1 Call PortOut(&H378, 3) Pause 1 Call PortOut(&H378, 7) Pause 1 Call PortOut(&H378, 15) Pause 1 Call PortOut(&H378, 31) Pause 1 Call PortOut(&H378, 63) Pause 1 Call PortOut(&H378, 127) Pause 1 Call PortOut(&H378, 255) Pause 1 GoTo M1 End Sub