Project showcase
Balilla Pinball

Balilla Pinball

Flattened pinball table: no legs and head. Fixed on cubes moving orizontally, two door spring locks are used to push the ball.

  • 774 views
  • 2 comments
  • 2 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
Rubbish: bench, door, loudspeaker etc...
×1

About this project

Sort of optical closet in fake wood and beast-shaped, characterised from the facility that makes it possible to shot repeatedly the ball. For being a game based on a scale model it is comparable to the italian table football.

Electromechanical features are the flippers from which the acquired Italian word“flipper” originates, meaning the game. And also is the "mushroom" obstacle, modern version of that role filled from the nail in the ancient tables.

Being easely recognizable it can be considered as a cooperative form of the pop design object. From the Sixties are the models we are still improving to be produced in series.

While the positive standard has been established, the pinball became able to include different contents, up to the moment of having revisited the predominant themes of the mass culture.

And as so many themes of the popular culture have been seen (used) as citations in it, the Pinball can be considered an autonomous genus within the category of marble games.

Code

balillaFlipperArduino
// rather than 4 working piezo targets, there is a second button target named Secchio (Bersa was the first). But it works fine.

#include <LiquidCrystal.h>
LiquidCrystal lcd(6,5,4,3,2,1);
#include "pitches.h" // pin7 per cono audio
int melody[] = {// sequenza di note
  NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
int noteDurations[] = {// note durations: 4 = quarter note, 8 = eighth note, etc.:
  4, 8, 8, 4,4,4,4,4 };
const int puntoLED = 13;     // Verde Led
const int bigliaLED = 8;     // Rosso Led
//const int ledPin3 = 12;    // libero
const int  bersaBUT = 11;    // BERSAGLIO-Switch//
int buttonPushCounter = -1;  // Contatore Bers
int buttonState = 0;         // current State
int lastButtonState = 0;     // previous state

const int  bigliaBUT = 1;    // BIGLIA-Switch
int buttonPushCounter2 = 0;  // Contatore Bigl
int buttonState2 = 0;        // current State
int lastButtonState2 = 0;    // previous state

const int secchioBUT = 9;    // SECCHIELLO-Switch//
int buttonState4 = 0;        // current State

void setup() {
  pinMode(bersaBUT, INPUT);
  pinMode(bigliaBUT, INPUT);
  //pinMode(buttonPin3, INPUT);
  pinMode(secchioBUT, INPUT);
  pinMode(bigliaLED, OUTPUT);
  pinMode(puntoLED, OUTPUT);
  //  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.setCursor(0, 0); //   MESSAGGIO INIZIALE
  lcd.print("ElettroBiliardin");
  lcd.setCursor(0, 1);// pinBag IPPOCAMPO   pinBAGaTElle
  lcd.print("BagatelleOpSys.1");
  delay(2000);
  for (int thisNote = 2; thisNote < 6; thisNote++) { //
    int noteDuration = 1000/noteDurations[thisNote];
    tone(7, melody[thisNote],noteDuration); //su pin7 esegui il Suono di Intro (+ bersaglio + biglia)
    int pauseBetweenNotes = noteDuration * 1.50;
    delay(pauseBetweenNotes);
  }
}

void loop(){
  lcd.setCursor(0, 0);           //       prima riga del display  -  PUNTEGGIO
    buttonState = analogRead(0)+analogRead(1)+analogRead(2)+analogRead(3);// ANALOG INPUT
  if (buttonState != lastButtonState) { // ogni volta che  azionato il tasto
    if (buttonState > 10 /*== HIGH*/) {
      lcd.print("bersaglioColpito");
      digitalWrite(puntoLED, HIGH); // accendi il rispettivo LED
      delay(800);
      buttonPushCounter++;
    }
    for (int thisNote = 6; thisNote < 8; thisNote++) { // l'intero e' di 8 misure
      int noteDuration = 1000/noteDurations[thisNote];
      tone(7, melody[thisNote],noteDuration); //pin7 esegui il Suono di punto segnato
      int pauseBetweenNotes = noteDuration * 0.80;
      delay(pauseBetweenNotes);
    }
  }
  else {
    lcd.print("Punti_");    // 17+1
    lcd.println(buttonPushCounter, DEC); //    mostra Numero Punti
    lcd.println("       ");
    digitalWrite(puntoLED, LOW);
  }
//  }
  if ((buttonPushCounter % 5 == 0)&&(buttonPushCounter > 4)){ //  Loopmode
    digitalWrite(bigliaLED, HIGH);  //  rosso
    digitalWrite(puntoLED, HIGH); //  verde
    for (int thisNote = 4; thisNote < 7; thisNote++) { // 8     //
      int noteDuration = 1000/noteDurations[thisNote];          //
      tone(7, melody[thisNote],noteDuration);                   //
      int pauseBetweenNotes = noteDuration * 0.30; // se il valore aumenta, lo sblocco  meno sensibile
      delay(pauseBetweenNotes);
    } //rimane bloccato fino al cambio del pushButtCount,
  }
  else {
    //    digitalWrite(bigliaLED, LOW); //gialloblu
    noTone(7);
  }
  lastButtonState = buttonState;  

  /////
  buttonState4 = digitalRead(secchioBUT);

  lcd.setCursor(0, 1);                // seconda riga del display  -  N BIGLIA
  buttonState2 = digitalRead(bigliaBUT);
  if (buttonState2 != lastButtonState2) {
    if (buttonState2 == HIGH) {
      lcd.print("giu,bigliaPersa!");
      delay(800);
      buttonPushCounter2++;
      //      Serial.println("butt2_on");
      digitalWrite(bigliaLED, HIGH);
    }
    for (int thisNote = 0; thisNote < 3; thisNote++) { //
      int noteDuration = 1000/noteDurations[thisNote];
      tone(7, melody[thisNote],noteDuration);// esegui il Suono di biglia persa
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
    }
  }
  if (buttonPushCounter2 > 3) {// se le "Biglie Perse" sono Tre
    lcd.setCursor(0, 0);
    for (int thisNote = 0; thisNote < 4; thisNote++) { //
      int noteDuration = 2000/noteDurations[thisNote];
      tone(7, melody[thisNote],noteDuration);// esegui il Suono di "fine partita"
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
    }
    lcd.print("finePartita     "); // game over
    delay(5000); 
    buttonPushCounter2 = 1;
    buttonPushCounter = 0;
    for (int thisNote = 7; thisNote > 3; thisNote--) { //
      int noteDuration = 2000/noteDurations[thisNote];
      tone(7, melody[thisNote],noteDuration);// esegui Suono di ri-inizio partita
      int pauseBetweenNotes = noteDuration * 1.30;
      delay(pauseBetweenNotes);
    }
  }
  else {
    lcd.print("Biglia_");//
    lcd.println(buttonPushCounter2, DEC);//    mostra Numero Biglia 
    lcd.println("      ");                 //
    digitalWrite(bigliaLED, LOW);
  }
  lastButtonState2 = buttonState2;
}

Schematics

balillapinb
Circuit to display score and ballnumber:
4 piezo, 2 toggleswitch, 2 led, 1 lcd, 1 loudspeaker.
Sbv3anqt11sepqecbipz

Comments

Similar projects you might like

Build a Pinball Machine

Project showcase by grahamasker

  • 4,076 views
  • 9 comments
  • 13 respects

Arduino Conversion of an EM Pinball Machine

Project showcase by Frogger1108

  • 6,158 views
  • 15 comments
  • 29 respects

PinBall Table on Arduino

by Ivan

  • 5,440 views
  • 4 comments
  • 16 respects

Arduino Ping Pong Pinball

Project tutorial by joesinstructables

  • 5,975 views
  • 4 comments
  • 12 respects

Arduino Controlled Pinball Machine

Project tutorial by Bob Blomquist

  • 39,893 views
  • 49 comments
  • 115 respects

Homemade Arduino Pinball Machine

Project showcase by Frogger1108

  • 17,211 views
  • 17 comments
  • 70 respects
Add projectSign up / Login