Secret sauce that brings YouTube followers, views, likes
Get Free YouTube Subscribers, Views and Likes

Double the Power Part 2 - Showcasing the Upgraded LEGO Orient Express Train

Follow
Danjo Trains

Part 1:    • Double the Power  Modifying the LEGO...  

Welcome back to Danjo Trains!
Finally, we have the long awaited Orient Express part 2: electric boogaloo.

In this video, I present the complete design of the motorized Orient Express that utilizes TWO large motors and a differential gear. I also briefly cover Pybricks, as well as showcase the train going around my layout. Free instructions for this design are available on Rebrickable (see link below).

Enjoy the show!

0:00 Intro
0:42 Design
3:16 Pybricks (code in description)
4:24 Around the City (no talking)
5:38 Adding the Stickers
6:46 Outro

#lego #legotrain #legotrains #legomoc #legotrainmoc #modeltrain #modeltrains #train #trains #legocity #streetrunning


Rebrickable
Free instructions: https://rebrickable.com/mocs/MOC1822...


Music
George Street Shuffle by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/...
Source: http://incompetech.com/music/royalty...
Artist: http://incompetech.com/


Pybricks
Software: https://pybricks.com/install/pybricks...
Double Motor Code (copy + paste):



from pybricks.pupdevices import Motor, Remote
from pybricks.parameters import Button, Port
from pybricks.tools import wait, StopWatch

train_A = Motor(Port.A)
train_B = Motor(Port.B)
remote = Remote()

#Get the settings for motor A.
max_speed_A, acceleration_A, torque_A = train_A.control.limits()

#Get the settings for motor B.
max_speed_B, acceleration_B, torque_B = train_B.control.limits()

#Change 0.5 to something smaller for more realism.
train_A.control.limits(acceleration = acceleration_A * 0.5)
train_B.control.limits(acceleration = acceleration_B * 0.5)

#Choose how many speeds steps you want.
NUM_STEPS_A = 10
STEP_NOW_A = 0

NUM_STEPS_B = 10
STEP_NOW_B = 0

#Configure Motor_A
while True:

#Wait for any button to be pressed.
pressed = ()
while not pressed:
pressed = remote.buttons.pressed()
wait(10)

#Depending on what was pressed, get the speed level.
if Button.LEFT_PLUS in pressed:
STEP_NOW_A += 1
if Button.LEFT_MINUS in pressed:
STEP_NOW_A = 1
if Button.LEFT in pressed:
STEP_NOW_A = 0

#Limit level to the maximum number of steps.
STEP_NOW_A = max(NUM_STEPS_A, min(STEP_NOW_A, NUM_STEPS_A))
print("Speed level:", STEP_NOW_A)

#Drive the train at the requested speed.
if STEP_NOW_A:
train_A.run(max_speed_A * STEP_NOW_A // NUM_STEPS_A)
else:
train_A.stop()

#Depending on what was pressed, get the speed level.
if Button.RIGHT_PLUS in pressed:
STEP_NOW_B += 1
if Button.RIGHT_MINUS in pressed:
STEP_NOW_B = 1
if Button.RIGHT in pressed:
STEP_NOW_B = 0

#Limit level to the maximum number of steps.
STEP_NOW_B = max(NUM_STEPS_B, min(STEP_NOW_B, NUM_STEPS_B))
print("Speed level:", STEP_NOW_B)

#Drive the train at the requested speed.
if STEP_NOW_B:
train_B.run(max_speed_B * STEP_NOW_B // NUM_STEPS_B)
else:
train_B.stop()

#Wait for the button to be released.
while pressed:
pressed = remote.buttons.pressed()
wait(10)

posted by vedlagdeuh