Moin Micha,
ja klar, unbedingt, ist aber noch mit der alten SW-Version 2.3.3 geschrieben. Mit der neuen 2.4.0 könnte man da Sachen in Unterprogramme legen.
Egal.
Oben links werden die Werte einmal eingestellt:
l = 20 Helligkeit der Leds
s = 20 Startgeschwindigkeit der Lok
m = 60 Höchstgeschwindigkeit
n = 35 Vmax im Rangiergang
Darunter ist die "Licht"-Schleife und darunter die zwei Sounds.
Rechts oben wird die Fahrgeschwindigkeit berechnet (Slider2)
Darunter der Umschaltmechanismus für den Rangiergang (Slider1)
So schön ist bei mir selten ein Modell gefahren, eingebaut ist aber auch kein Eisenbahnmotor, sondern ein M-Motor
Have fun!
Grüße
Werner
Hier ist übrigens das Programm
{
"mainCanvas": {
"positionedSequences": [
{
"position": {
"x": -5.02455473,
"y": 3.65850067
},
"PositionedObject": {
"instructions": [
{
"operation": "Start"
},
{
"operation": "LoopForever",
"innerSequences": [
{
"instructions": [
{
"operation": "IfSwitch",
"literalParams": [
false
],
"blockParams": [
{
"operation": "NotEqualOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-38"
},
null
]
}
],
"innerSequences": [
{
"instructions": [
{
"operation": "IfSwitch",
"literalParams": [
false
],
"blockParams": [
{
"operation": "LessThanOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-38"
},
null
]
}
],
"innerSequences": [
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
21.0,
0.0
],
"blockParams": [
null,
{
"operation": "/Generic/Math/InvertInput",
"literalParams": [
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
18.0
]
}
]
}
]
}
]
},
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
21.0,
0.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
18.0
]
}
]
}
]
}
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
17.0,
0.0
],
"blockParams": [
null,
{
"operation": "DivisionOperator",
"literalParams": [
100.0,
100.0
],
"blockParams": [
{
"operation": "MinusOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
23.0
]
},
{
"operation": "GlobalVariableFetch",
"literalParams": [
18.0
]
}
]
},
null
]
}
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
21.0,
0.0
],
"blockParams": [
null,
{
"operation": "PlusOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
21.0
]
},
{
"operation": "MultiplyOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-38"
},
{
"operation": "GlobalVariableFetch",
"literalParams": [
17.0
]
}
]
}
]
}
]
},
{
"operation": "/Widgets/widget-instruction-block-44",
"literalParams": [
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
21.0
]
}
]
},
{
"operation": "MotorPower",
"literalParams": [
0.0,
50.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
21.0
]
}
]
}
]
},
{
"instructions": [
{
"operation": "MotorFloat",
"literalParams": [
0.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
21.0,
0.0
]
},
{
"operation": "/Widgets/widget-instruction-block-44",
"literalParams": [
0.0
]
}
]
}
]
}
]
}
]
}
]
}
},
{
"position": {
"x": -14.8903179,
"y": 3.8356514
},
"PositionedObject": {
"instructions": [
{
"operation": "Start"
},
{
"operation": "GlobalVariableStore",
"literalParams": [
11.0,
20.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
18.0,
20.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
12.0,
60.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
13.0,
35.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
23.0,
0.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
12.0
]
}
]
}
]
}
},
{
"position": {
"x": -14.520668,
"y": -2.068437
},
"PositionedObject": {
"instructions": [
{
"operation": "StartOnTrue",
"literalParams": [
false
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-42"
}
]
},
{
"operation": "/FreePlay/Sounds/1100-TrainHorns",
"literalParams": [
1104.0
]
}
]
}
},
{
"position": {
"x": -11.6841154,
"y": -2.12761
},
"PositionedObject": {
"instructions": [
{
"operation": "StartOnTrue",
"literalParams": [
false
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-40"
}
]
},
{
"operation": "/FreePlay/Sounds/1100-TrainHorns",
"literalParams": [
1100.0
]
}
]
}
},
{
"position": {
"x": -14.7533751,
"y": 1.405505
},
"PositionedObject": {
"instructions": [
{
"operation": "StartOnTrue",
"literalParams": [
false
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-41"
}
]
},
{
"operation": "IfSwitch",
"literalParams": [
false
],
"blockParams": [
{
"operation": "EqualOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
0.0
]
},
null
]
}
],
"innerSequences": [
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
0.0,
100.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
11.0
]
}
]
}
]
},
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
0.0,
0.0
]
}
]
}
]
},
{
"operation": "LightPercentage",
"literalParams": [
1.0,
0.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
0.0
]
}
]
},
{
"operation": "WaitForTime",
"literalParams": [
0.2
]
}
]
}
},
{
"position": {
"x": -5.08109474,
"y": -2.00347281
},
"PositionedObject": {
"instructions": [
{
"operation": "Start"
},
{
"operation": "LoopForever",
"innerSequences": [
{
"instructions": [
{
"operation": "IfSwitch",
"literalParams": [
false
],
"blockParams": [
{
"operation": "GreaterThanOperator",
"literalParams": [
0.0,
0.0
],
"blockParams": [
{
"operation": "/Widgets/widget-reporter-block-37"
},
null
]
}
],
"innerSequences": [
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
1.0,
50.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
23.0,
0.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
13.0
]
}
]
}
]
},
{
"instructions": [
{
"operation": "GlobalVariableStore",
"literalParams": [
1.0,
0.0
]
},
{
"operation": "GlobalVariableStore",
"literalParams": [
23.0,
0.0
],
"blockParams": [
null,
{
"operation": "GlobalVariableFetch",
"literalParams": [
12.0
]
}
]
}
]
}
]
},
{
"operation": "/Widgets/widget-instruction-block-43",
"literalParams": [
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
1.0
]
}
]
},
{
"operation": "/Widgets/widget-instruction-block-37",
"literalParams": [
0.0
],
"blockParams": [
{
"operation": "GlobalVariableFetch",
"literalParams": [
1.0
]
}
]
}
]
}
]
}
]
}
}
],
"positionedDataBlocks": [],
"positionedCommentBlocks": [],
"viewState": {
"position": {
"x": -0.9991026,
"y": -2.2893796
},
"scale": 10.0
}
},
"activeStartupCanvases": [
"Programming",
"Palette"
],
"autoPlayOnStartup": false
}
Dirk1313
, MTM
, Thomas52xxx
, BRUNO
gefällt das (4 Mitglieder)