Lego slot machine
Simple slot Machine made out of LEGO® Mindstorms® EV3 31313 set, LEGO® 6x6 All Terrain Tow Truck 42070 set, and some other parts. Programmed on Python with EV3dev software installed on EV3. 3D Model made with LDraw system of tools and LeoCAD application. Imported to Stud.io to Make Instructions.
Sometimes you haven’t got enough parts to build a model, so I split instructions into 3 main sections:
print "ready"
wait touch sensor to be pressed and released # wait for user to calibrate motors
reset A motor
reset B motor
reset C motor
repeat forever:
wait touch sensor to be pressed and released
start motor A at random speed
start motor B at random speed
start motor C at random speed
wait touch sensor to be pressed and released
stop motor A without brake
stop motor B without brake
stop motor C without brake
wait touch sensor to be pressed and released
set position of A motor to round(motor A position ÷ 45) * 45
set position of B motor to round(motor B position ÷ 45) * 45
set position of C motor to round(motor C position ÷ 45) * 45