Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Quintrix
Published © GPL3+

How To Make A Slot Machine

Simple Arduino project for beginners with Arduino and Oled dispaly.

IntermediateProtip1 hour1,101
How To Make A Slot Machine

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
OLED Display 128x64 0.96 inch, I2C Interface
DIYables OLED Display 128x64 0.96 inch, I2C Interface
×1
Switch Actuator, Head for spring return push-button
Switch Actuator, Head for spring return push-button
×1
Through Hole Resistor, 470 ohm
Through Hole Resistor, 470 ohm
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Visuino - Graphical Development Environment for Arduino
Visuino - Graphical Development Environment for Arduino

Story

Read more

Schematics

SCHEMATIC DIAGRAM

Code

code INO format

C/C++
//----------------------------------------------
//
//         Sketch Generated by Visuino
//               www.visuino.com
//           Version 8.0.0.79
//
//------------------ Source --------------------
//
// SLOT MACHINE Arduino NANO.visuino
//
 //----------------------------------------------

#define VISUINO_ARDUINO_NANO
#define _MITOV_DISPLAY_SSD1306_I2C

#include <OpenWire.h>
#include <Mitov.h>
#include <Wire.h>
#include <Mitov_Basic_I2C.h>
#include <Mitov_Display_SSD1306_I2C.h>
#include <Mitov_Graphics.h>
#include <Mitov_Graphics_Monochrome.h>
#include <Fonts\Fixed\GraphicsFont5x7.h>
#include <Mitov_Timing.h>
#include <Mitov_LogicGates.h>
#include <Mitov_BinaryGenerators.h>
#include <Mitov_Switch.h>
#include <Mitov_CommonDemux.h>
#include <Mitov_RandomGenerator.h>
#include <Mitov_Counter.h>
#include <Mitov_Converters.h>



// Shared Component Member Variables

namespace ComponentVariables
{
class
{
public:
  bool Value1 : 1;
  bool Value2 : 1;
  bool Value3 : 1;
  bool Value4 : 1;
  bool Value5 : 1;
  bool Value6 : 1;
  bool Value7 : 1;
  bool Value8 : 1;
  bool Value9 : 1;
  bool Value10 : 1;
  bool Value11 : 1;
  bool Value12 : 1;
  bool Value13 : 1;
  bool Value14 : 1;
  bool Value15 : 1;
  bool Value16 : 1;
  bool Value17 : 1;
  bool Value18 : 1;
  bool Value19 : 1;
  bool Value20 : 1;
  bool Value21 : 1;
  bool Value22 : 1;
  bool Value23 : 1;
  bool Value24 : 1;
  bool Value25 : 1;
  bool Value26 : 1;
  bool Value27 : 1;
  bool Value28 : 1;
  bool Value29 : 1;
  bool Value30 : 1;
  bool Value31 : 1;
  bool Value32 : 1;
  bool Value33 : 1;
  bool Value34 : 1;
  bool Value35 : 1;
  bool Value36 : 1;
  bool Value37 : 1;
  bool Value38 : 1;
  bool Value39 : 1;
  bool Value40 : 1;
  bool Value41 : 1;
  bool Value42 : 1;
  bool Value43 : 1;
  bool Value44 : 1;
  bool Value45 : 1;
  bool Value46 : 1;
  bool Value47 : 1;
  bool Value48 : 1;
  bool Value49 : 1;
  bool Value50 : 1;
  uint32_t Value51 : 12;
  bool Value52 : 1;
  bool Value53 : 1;
  bool Value54 : 1;
  bool Value55 : 1;
  bool Value56 : 1;
  bool Value57 : 1;
  bool Value58 : 1;
  bool Value59 : 1;
  bool Value60 : 1;
  bool Value61 : 1;
  bool Value62 : 1;
  bool Value63 : 1;
  bool Value64 : 1;
  bool Value65 : 1;
  bool Value66 : 1;
  bool Value67 : 1;
  bool Value68 : 1;
  bool Value69 : 1;
  bool Value70 : 1;
  bool Value71 : 1;
  bool Value72 : 1;
  bool Value73 : 1;
  bool Value74 : 1;
  bool Value75 : 1;
  uint32_t Value76 : 12;
  bool Value77 : 1;
  bool Value78 : 1;
  bool Value79 : 1;
  bool Value80 : 1;
  bool Value81 : 1;
  bool Value82 : 1;
  bool Value83 : 1;
  bool Value84 : 1;
  bool Value85 : 1;
  bool Value86 : 1;
  bool Value87 : 1;
  bool Value88 : 1;
  bool Value89 : 1;
  uint32_t Value90 : 12;
  bool Value91 : 1;
  bool Value92 : 1;
  bool Value93 : 1;
  bool Value94 : 1;
  bool Value95 : 1;
  bool Value96 : 1;
  bool Value97 : 1;
  bool Value98 : 1;
  bool Value99 : 1;
  bool Value100 : 1;
  bool Value101 : 1;
  bool Value102 : 1;
  bool Value103 : 1;
  bool Value104 : 1;
  bool Value105 : 1;
  bool Value106 : 1;
  bool Value107 : 1;
  bool Value108 : 1;
  bool Value109 : 1;
  bool Value110 : 1;
  bool Value111 : 1;
  bool Value112 : 1;
  bool Value113 : 1;
  bool Value114 : 1;
  bool Value115 : 1;
  bool Value116 : 1;
  bool Value117 : 1;
  bool Value118 : 1;
  bool Value119 : 1;
  bool Value120 : 1;
  bool Value121 : 1;
  bool Value122 : 1;
  bool Value123 : 1;
  bool Value124 : 1;
  bool Value125 : 1;
  bool Value126 : 1;
  bool Value127 : 1;
  bool Value128 : 1;
  bool Value129 : 1;
  bool Value130 : 1;
  bool Value131 : 1;
  bool Value132 : 1;
  bool Value133 : 1;
  bool Value134 : 1;
  bool Value135 : 1;
  bool Value136 : 1;
  bool Value137 : 1;
  bool Value138 : 1;
  bool Value139 : 1;
  bool Value140 : 1;
  bool Value141 : 1;
  bool Value142 : 1;
  bool Value143 : 1;
  bool Value144 : 1;
  bool Value145 : 1;
  bool Value146 : 1;
  uint32_t Value147 : 7;
  bool Value148 : 1;
  uint32_t Value149 : 3;
  bool Value150 : 1;
  bool Value151 : 1;
  bool Value152 : 1;
  bool Value153 : 1;
  bool Value154 : 1;
  bool Value155 : 1;
  bool Value156 : 1;
  bool Value157 : 1;
  bool Value158 : 1;
  bool Value159 : 1;
  bool Value160 : 1;
  bool Value161 : 1;
  bool Value162 : 1;
  bool Value163 : 1;
  bool Value164 : 1;
  bool Value165 : 1;
  bool Value166 : 1;
  bool Value167 : 1;
  bool Value168 : 1;
  bool Value169 : 1;
  bool Value170 : 1;
  bool Value171 : 1;
  bool Value172 : 1;
  bool Value173 : 1;

} BitFields;

class Variable1
{
public:
  inline static bool GetValue() { return BitFields.Value1; }
  inline static void SetValue( bool AValue ) { BitFields.Value1 = AValue; }

};

class Variable2
{
public:
  inline static bool GetValue() { return BitFields.Value2; }
  inline static void SetValue( bool AValue ) { BitFields.Value2 = AValue; }

};

class Variable3
{
public:
  inline static bool GetValue() { return BitFields.Value3; }
  inline static void SetValue( bool AValue ) { BitFields.Value3 = AValue; }

};

class Variable4
{
public:
  inline static bool GetValue() { return BitFields.Value4; }
  inline static void SetValue( bool AValue ) { BitFields.Value4 = AValue; }

};

class Variable5
{
public:
  inline static bool GetValue() { return BitFields.Value5; }
  inline static void SetValue( bool AValue ) { BitFields.Value5 = AValue; }

};

class Variable6
{
public:
  inline static bool GetValue() { return BitFields.Value6; }
  inline static void SetValue( bool AValue ) { BitFields.Value6 = AValue; }

};

class Variable7
{
public:
  inline static bool GetValue() { return BitFields.Value7; }
  inline static void SetValue( bool AValue ) { BitFields.Value7 = AValue; }

};

class Variable8
{
public:
  inline static bool GetValue() { return BitFields.Value8; }
  inline static void SetValue( bool AValue ) { BitFields.Value8 = AValue; }

};

class Variable9
{
public:
  inline static bool GetValue() { return BitFields.Value9; }
  inline static void SetValue( bool AValue ) { BitFields.Value9 = AValue; }

};

class Variable10
{
public:
  inline static bool GetValue() { return BitFields.Value10; }
  inline static void SetValue( bool AValue ) { BitFields.Value10 = AValue; }

};

class Variable11
{
public:
  inline static bool GetValue() { return BitFields.Value11; }
  inline static void SetValue( bool AValue ) { BitFields.Value11 = AValue; }

};

class Variable12
{
public:
  inline static bool GetValue() { return BitFields.Value12; }
  inline static void SetValue( bool AValue ) { BitFields.Value12 = AValue; }

};

class Variable13
{
public:
  inline static bool GetValue() { return BitFields.Value13; }
  inline static void SetValue( bool AValue ) { BitFields.Value13 = AValue; }

};

class Variable14
{
public:
  inline static bool GetValue() { return BitFields.Value14; }
  inline static void SetValue( bool AValue ) { BitFields.Value14 = AValue; }

};

class Variable15
{
public:
  inline static bool GetValue() { return BitFields.Value15; }
  inline static void SetValue( bool AValue ) { BitFields.Value15 = AValue; }

};

class Variable16
{
public:
  inline static bool GetValue() { return BitFields.Value16; }
  inline static void SetValue( bool AValue ) { BitFields.Value16 = AValue; }

};

class Variable17
{
public:
  inline static bool GetValue() { return BitFields.Value17; }
  inline static void SetValue( bool AValue ) { BitFields.Value17 = AValue; }

};

class Variable18
{
public:
  inline static bool GetValue() { return BitFields.Value18; }
  inline static void SetValue( bool AValue ) { BitFields.Value18 = AValue; }

};

class Variable19
{
public:
  inline static bool GetValue() { return BitFields.Value19; }
  inline static void SetValue( bool AValue ) { BitFields.Value19 = AValue; }

};

class Variable20
{
public:
  inline static bool GetValue() { return BitFields.Value20; }
  inline static void SetValue( bool AValue ) { BitFields.Value20 = AValue; }

};

class Variable21
{
public:
  inline static bool GetValue() { return BitFields.Value21; }
  inline static void SetValue( bool AValue ) { BitFields.Value21 = AValue; }

};

class Variable22
{
public:
  inline static bool GetValue() { return BitFields.Value22; }
  inline static void SetValue( bool AValue ) { BitFields.Value22 = AValue; }

};

class Variable23
{
public:
  inline static bool GetValue() { return BitFields.Value23; }
  inline static void SetValue( bool AValue ) { BitFields.Value23 = AValue; }

};

class Variable24
{
public:
  inline static bool GetValue() { return BitFields.Value24; }
  inline static void SetValue( bool AValue ) { BitFields.Value24 = AValue; }

};

class Variable25
{
public:
  inline static bool GetValue() { return BitFields.Value25; }
  inline static void SetValue( bool AValue ) { BitFields.Value25 = AValue; }

};

class Variable26
{
public:
  inline static bool GetValue() { return BitFields.Value26; }
  inline static void SetValue( bool AValue ) { BitFields.Value26 = AValue; }

};

class Variable27
{
public:
  inline static bool GetValue() { return BitFields.Value27; }
  inline static void SetValue( bool AValue ) { BitFields.Value27 = AValue; }

};

class Variable28
{
public:
  inline static bool GetValue() { return BitFields.Value28; }
  inline static void SetValue( bool AValue ) { BitFields.Value28 = AValue; }

};

class Variable29
{
public:
  inline static bool GetValue() { return BitFields.Value29; }
  inline static void SetValue( bool AValue ) { BitFields.Value29 = AValue; }

};

class Variable30
{
public:
  inline static bool GetValue() { return BitFields.Value30; }
  inline static void SetValue( bool AValue ) { BitFields.Value30 = AValue; }

};

class Variable31
{
public:
  inline static bool GetValue() { return BitFields.Value31; }
  inline static void SetValue( bool AValue ) { BitFields.Value31 = AValue; }

};

class Variable32
{
public:
  inline static bool GetValue() { return BitFields.Value32; }
  inline static void SetValue( bool AValue ) { BitFields.Value32 = AValue; }

};

class Variable33
{
public:
  inline static bool GetValue() { return BitFields.Value33; }
  inline static void SetValue( bool AValue ) { BitFields.Value33 = AValue; }

};

class Variable34
{
public:
  inline static bool GetValue() { return BitFields.Value34; }
  inline static void SetValue( bool AValue ) { BitFields.Value34 = AValue; }

};

class Variable35
{
public:
  inline static bool GetValue() { return BitFields.Value35; }
  inline static void SetValue( bool AValue ) { BitFields.Value35 = AValue; }

};

class Variable36
{
public:
  inline static bool GetValue() { return BitFields.Value36; }
  inline static void SetValue( bool AValue ) { BitFields.Value36 = AValue; }

};

class Variable37
{
public:
  inline static bool GetValue() { return BitFields.Value37; }
  inline static void SetValue( bool AValue ) { BitFields.Value37 = AValue; }

};

class Variable38
{
public:
  inline static bool GetValue() { return BitFields.Value38; }
  inline static void SetValue( bool AValue ) { BitFields.Value38 = AValue; }

};

class Variable39
{
public:
  inline static bool GetValue() { return BitFields.Value39; }
  inline static void SetValue( bool AValue ) { BitFields.Value39 = AValue; }

};

class Variable40
{
public:
  inline static bool GetValue() { return BitFields.Value40; }
  inline static void SetValue( bool AValue ) { BitFields.Value40 = AValue; }

};

class Variable41
{
public:
  inline static bool GetValue() { return BitFields.Value41; }
  inline static void SetValue( bool AValue ) { BitFields.Value41 = AValue; }

};

class Variable42
{
public:
  inline static bool GetValue() { return BitFields.Value42; }
  inline static void SetValue( bool AValue ) { BitFields.Value42 = AValue; }

};

class Variable43
{
public:
  inline static bool GetValue() { return BitFields.Value43; }
  inline static void SetValue( bool AValue ) { BitFields.Value43 = AValue; }

};

class Variable44
{
public:
  inline static bool GetValue() { return BitFields.Value44; }
  inline static void SetValue( bool AValue ) { BitFields.Value44 = AValue; }

};

class Variable45
{
public:
  inline static bool GetValue() { return BitFields.Value45; }
  inline static void SetValue( bool AValue ) { BitFields.Value45 = AValue; }

};

class Variable46
{
public:
  inline static bool GetValue() { return BitFields.Value46; }
  inline static void SetValue( bool AValue ) { BitFields.Value46 = AValue; }

};

class Variable47
{
public:
  inline static bool GetValue() { return BitFields.Value47; }
  inline static void SetValue( bool AValue ) { BitFields.Value47 = AValue; }

};

class Variable48
{
public:
  inline static bool GetValue() { return BitFields.Value48; }
  inline static void SetValue( bool AValue ) { BitFields.Value48 = AValue; }

};

class Variable49
{
public:
  inline static bool GetValue() { return BitFields.Value49; }
  inline static void SetValue( bool AValue ) { BitFields.Value49 = AValue; }

};

class Variable50
{
public:
  inline static bool GetValue() { return BitFields.Value50; }
  inline static void SetValue( bool AValue ) { BitFields.Value50 = AValue; }

};

class Variable51
{
public:
  inline static uint32_t GetValue() { return BitFields.Value51; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value51 = AValue; }

};

class Variable52
{
public:
  inline static bool GetValue() { return BitFields.Value52; }
  inline static void SetValue( bool AValue ) { BitFields.Value52 = AValue; }

};

class Variable53
{
public:
  inline static bool GetValue() { return BitFields.Value53; }
  inline static void SetValue( bool AValue ) { BitFields.Value53 = AValue; }

};

class Variable54
{
public:
  inline static bool GetValue() { return BitFields.Value54; }
  inline static void SetValue( bool AValue ) { BitFields.Value54 = AValue; }

};

class Variable55
{
public:
  inline static bool GetValue() { return BitFields.Value55; }
  inline static void SetValue( bool AValue ) { BitFields.Value55 = AValue; }

};

class Variable56
{
public:
  inline static bool GetValue() { return BitFields.Value56; }
  inline static void SetValue( bool AValue ) { BitFields.Value56 = AValue; }

};

class Variable57
{
public:
  inline static bool GetValue() { return BitFields.Value57; }
  inline static void SetValue( bool AValue ) { BitFields.Value57 = AValue; }

};

class Variable58
{
public:
  inline static bool GetValue() { return BitFields.Value58; }
  inline static void SetValue( bool AValue ) { BitFields.Value58 = AValue; }

};

class Variable59
{
public:
  inline static bool GetValue() { return BitFields.Value59; }
  inline static void SetValue( bool AValue ) { BitFields.Value59 = AValue; }

};

class Variable60
{
public:
  inline static bool GetValue() { return BitFields.Value60; }
  inline static void SetValue( bool AValue ) { BitFields.Value60 = AValue; }

};

class Variable61
{
public:
  inline static bool GetValue() { return BitFields.Value61; }
  inline static void SetValue( bool AValue ) { BitFields.Value61 = AValue; }

};

class Variable62
{
public:
  inline static bool GetValue() { return BitFields.Value62; }
  inline static void SetValue( bool AValue ) { BitFields.Value62 = AValue; }

};

class Variable63
{
public:
  inline static bool GetValue() { return BitFields.Value63; }
  inline static void SetValue( bool AValue ) { BitFields.Value63 = AValue; }

};

class Variable64
{
public:
  inline static bool GetValue() { return BitFields.Value64; }
  inline static void SetValue( bool AValue ) { BitFields.Value64 = AValue; }

};

class Variable65
{
public:
  inline static bool GetValue() { return BitFields.Value65; }
  inline static void SetValue( bool AValue ) { BitFields.Value65 = AValue; }

};

class Variable66
{
public:
  inline static bool GetValue() { return BitFields.Value66; }
  inline static void SetValue( bool AValue ) { BitFields.Value66 = AValue; }

};

class Variable67
{
public:
  inline static bool GetValue() { return BitFields.Value67; }
  inline static void SetValue( bool AValue ) { BitFields.Value67 = AValue; }

};

class Variable68
{
public:
  inline static bool GetValue() { return BitFields.Value68; }
  inline static void SetValue( bool AValue ) { BitFields.Value68 = AValue; }

};

class Variable69
{
public:
  inline static bool GetValue() { return BitFields.Value69; }
  inline static void SetValue( bool AValue ) { BitFields.Value69 = AValue; }

};

class Variable70
{
public:
  inline static bool GetValue() { return BitFields.Value70; }
  inline static void SetValue( bool AValue ) { BitFields.Value70 = AValue; }

};

class Variable71
{
public:
  inline static bool GetValue() { return BitFields.Value71; }
  inline static void SetValue( bool AValue ) { BitFields.Value71 = AValue; }

};

class Variable72
{
public:
  inline static bool GetValue() { return BitFields.Value72; }
  inline static void SetValue( bool AValue ) { BitFields.Value72 = AValue; }

};

class Variable73
{
public:
  inline static bool GetValue() { return BitFields.Value73; }
  inline static void SetValue( bool AValue ) { BitFields.Value73 = AValue; }

};

class Variable74
{
public:
  inline static bool GetValue() { return BitFields.Value74; }
  inline static void SetValue( bool AValue ) { BitFields.Value74 = AValue; }

};

class Variable75
{
public:
  inline static bool GetValue() { return BitFields.Value75; }
  inline static void SetValue( bool AValue ) { BitFields.Value75 = AValue; }

};

class Variable76
{
public:
  inline static uint32_t GetValue() { return BitFields.Value76; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value76 = AValue; }

};

class Variable77
{
public:
  inline static bool GetValue() { return BitFields.Value77; }
  inline static void SetValue( bool AValue ) { BitFields.Value77 = AValue; }

};

class Variable78
{
public:
  inline static bool GetValue() { return BitFields.Value78; }
  inline static void SetValue( bool AValue ) { BitFields.Value78 = AValue; }

};

class Variable79
{
public:
  inline static bool GetValue() { return BitFields.Value79; }
  inline static void SetValue( bool AValue ) { BitFields.Value79 = AValue; }

};

class Variable80
{
public:
  inline static bool GetValue() { return BitFields.Value80; }
  inline static void SetValue( bool AValue ) { BitFields.Value80 = AValue; }

};

class Variable81
{
public:
  inline static bool GetValue() { return BitFields.Value81; }
  inline static void SetValue( bool AValue ) { BitFields.Value81 = AValue; }

};

class Variable82
{
public:
  inline static bool GetValue() { return BitFields.Value82; }
  inline static void SetValue( bool AValue ) { BitFields.Value82 = AValue; }

};

class Variable83
{
public:
  inline static bool GetValue() { return BitFields.Value83; }
  inline static void SetValue( bool AValue ) { BitFields.Value83 = AValue; }

};

class Variable84
{
public:
  inline static bool GetValue() { return BitFields.Value84; }
  inline static void SetValue( bool AValue ) { BitFields.Value84 = AValue; }

};

class Variable85
{
public:
  inline static bool GetValue() { return BitFields.Value85; }
  inline static void SetValue( bool AValue ) { BitFields.Value85 = AValue; }

};

class Variable86
{
public:
  inline static bool GetValue() { return BitFields.Value86; }
  inline static void SetValue( bool AValue ) { BitFields.Value86 = AValue; }

};

class Variable87
{
public:
  inline static bool GetValue() { return BitFields.Value87; }
  inline static void SetValue( bool AValue ) { BitFields.Value87 = AValue; }

};

class Variable88
{
public:
  inline static bool GetValue() { return BitFields.Value88; }
  inline static void SetValue( bool AValue ) { BitFields.Value88 = AValue; }

};

class Variable89
{
public:
  inline static bool GetValue() { return BitFields.Value89; }
  inline static void SetValue( bool AValue ) { BitFields.Value89 = AValue; }

};

class Variable90
{
public:
  inline static uint32_t GetValue() { return BitFields.Value90; }
  inline static void SetValue( uint32_t AValue ) { BitFields.Value90 = AValue; }

};

class Variable91
{
public:
  inline static bool GetValue() { return BitFields.Value91; }
  inline static void SetValue( bool AValue ) { BitFields.Value91 = AValue; }

};

class Variable92
{
public:
  inline static bool GetValue() { return BitFields.Value92; }
  inline static void SetValue( bool AValue ) { BitFields.Value92 = AValue; }

};

class Variable93
{
public:
  inline static bool GetValue() { return BitFields.Value93; }
  inline static void SetValue( bool AValue ) { BitFields.Value93 = AValue; }

};

class Variable94
{
public:
  inline static bool GetValue() { return BitFields.Value94; }
  inline static void SetValue( bool AValue ) { BitFields.Value94 = AValue; }

};

class Variable95
{
public:
  inline static bool GetValue() { return BitFields.Value95; }
  inline static void SetValue( bool AValue ) { BitFields.Value95 = AValue; }

};

class Variable96
{
public:
  inline static bool GetValue() { return BitFields.Value96; }
  inline static void SetValue( bool AValue ) { BitFields.Value96 = AValue; }

};

class Variable97
{
public:
  inline static bool GetValue() { return BitFields.Value97; }
  inline static void SetValue( bool AValue ) { BitFields.Value97 = AValue; }

};

class Variable98
{
public:
  inline static bool GetValue() { return BitFields.Value98; }
  inline static void SetValue( bool AValue ) { BitFields.Value98 = AValue; }

};
...

This file has been truncated, please download it to see its full contents.

Credits

Quintrix
6 projects • 3 followers

Comments