Hi leute,
Ich will ein Byte Simulieren
Z.B bei eins sol das 1. lämpchen aufleuchen
bei 2. das zweite bei drei die ersten beiden bei 4 das 4. usw
mein Problem das erste Lämpchen bleibt immer aus außer bei 255
hier mein QT
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53:
| shape1.Brush.Color := clgray; shape2.Brush.Color := clgray; shape3.Brush.Color := clgray; shape4.Brush.Color := clgray; shape5.Brush.Color := clgray; shape6.Brush.Color := clgray; shape7.Brush.Color := clgray; shape8.Brush.Color := clgray;
X := StrToInt(edit1.text);
Y := X mod 2; X:= X div 2; if Y > 0 then Shape1.Brush.Color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape2.brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape3.Brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape4.Brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape5.Brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape6.Brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape7.Brush.color := clyellow else shape1.Brush.color := clgray;
Y := X mod 2; X:= X div 2; if Y > 0 then Shape8.brush.color := clyellow else shape1.Brush.color := clgray;
timer1. enabled := false |
Danke im vorraus
_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)