Lucky Mini Slot Machine

by KittenBot in Circuits > Gadgets

2282 Views, 14 Favorites, 0 Comments

Lucky Mini Slot Machine

BD893B47-3D5A-4634-90FE-C3C95066ACAB_1_201_a.jpeg
IMG_4493.jpg
IMG_4497.jpg
IMG_4489.jpg

Are you going to throw a party lately? or going to a carnival? or just want to have fun with your kids? See if this mini slot machine can make your event much more fun! 


This machine would choose a number itself and show the number on the screen. When people press the joystick, the number in the middle of the machine changes. When it changes to the number that is shown, a prize would come out.


If you like our projects and tutorials, you can follow us on TwitterFacebook, and Youtube for more interesting STEM projects and ideas.

Supplies

Hardware

paperboard * 1

several LEGO bricks

3D printed reel * 1

Geekservo 2KG servo *2

Robotbit base *1

Robotbit Edu *1

18650 Lithium Battery *1

Future board *1

Sugar Joystick *1


Software

Kittenblock


Tool

Utility knife

scissors

ruler

pencil

double-side tape

3M tape

markers

3D printer

Idea

slot machine

The slot machine is basically a cuboid, so we will use a piece of paperboard to cover the LEGO working parts and draw something on it to make it look like a real slot machine. The turning of the reel and the presentation of the prize require a servo.

The 3D Printed Reel

CB8071F3-BC8C-4B54-A2DE-EE37BCF77F77_1_105_c.jpeg
987AFE0F-AAA3-43CB-9D4C-B449E6E4D10A_1_105_c.jpeg
7DC2AB74-9C3D-43F6-BC4D-7F8CCCD98E13_1_105_c.jpeg

When finished printing, get rid of the extra parts, and write down the numbers with markers.

Assemble the Inner Part of the Machine

image (1).png

Assemble everything following the assembly instructions.

Design the Cover

423EA504-37E7-48C4-B331-D0CE0CC9C847_1_105_c.jpeg
96AC15A7-A16F-4562-BC15-94F7EEE94145_1_105_c.jpeg

Draw on the paperboard and cut out the parts we need.

Cover the Lego Framework With the Paperboard Cover

DFA75D99-C84B-42E9-AE38-E81BF04058FA_1_105_c.jpeg

Use LEGO technic rubber stoppers to fix the cover to the LEGO parts.

Draw on the Cover!

B7E0A5EA-9496-4F8A-A7C5-846C3961A52F_1_105_c.jpeg

Draw everything you like on the slot machine. We drew some patterns to make it looks more like a real slot machine.

Write the Program

We need to write the program to show a random number on the screen and make the reel turn to a random number and analyze whether the random number on the screen is the same as the one on the reel.


Download the program

Write the Program: First Step - Set Variables

image (2).png

Set the x variable as the goal number (the number shown on the screen, and the reel needs to turn to this number to win); set the y variable as the reel number.

Write the Program: Second Step - to Analyze

image (3).png

To analyze whether x equals y. If so, then win the prize (the prize tray then extends); if not, then the game continues and nobody wins.

Write the Program: Third Step - Joystick Module

image (4).png
image (5).png

The triggering of the joystick changes the y variable. As y changes, the angle of the servo that controls the reel changes too. (the servo angles need to be adjusted before we write the program.)

Write the Program: Fourth Step - Indication

image (6).png
image (7).png
image (8).png

Add a boot animation to the beginning of the program.

Add the display of the goal number to the middle of the program. When the joystick is triggered once, the indication sound and image of not winning will be added to the program part that runs when not winning; same as the winning parts.

Now You Finish the Slot Machine!

Give it a go and have fun with your family and friends!