Project showcase
Balilla Flipper

Balilla Flipper

Flattened pinball table: no legs & head. Fixed on as many wood cubes moving horizontally, two door spring locks are used to push the ball.

  • 422 views
  • 0 comments
  • 0 respects

Components and supplies

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

Apps and online services

bagatelle os

About this project

Sort of beast shaped optical closet in fake wood, equipped with the facility that make it possible to shot repeatedly the balls. For being a game based on a scale model the pinball is comparable to the more essential table football.

Electromechanical features are the flippers from which “flipper” became the acquired Italian word to indicate the game. And the "mushroom" obstacle, modern version of that deflecting role filled from the nail in the ancient tables.

Dating back to the Sixties are the models we are still improving to be produced in series. And as the positive standard has been established, the pinball became able to include different contents every time, up to revisit the major themes from the mass culture.

Being easily recognisable it can be considered as a cooperative form of pop design object. And since this point of view let us observe many themes of the occidental culture as citation in it, the Pinball can be considered a complete genus inside the category of marble games.

As a funny game provided with lights and sounds, it has been surpassed by the videogame, because of the more easiness in production and distribution. Whereas as the time-consuming object to which we are trusting as if it had the capability to show us a right direction, it has been overtaked by the mobile phone.

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

Arduino Conversion of an EM Pinball Machine

Project showcase by Frogger1108

  • 3,488 views
  • 3 comments
  • 24 respects

A Simple Simon Says Game

Project showcase by Arduino_Scuola

  • 15,285 views
  • 7 comments
  • 12 respects

LED Dice

Project showcase by EvdS

  • 14,289 views
  • 11 comments
  • 49 respects

Halloween Laser Maze

Project showcase by Sam Horne

  • 7,748 views
  • 6 comments
  • 21 respects

LCD Game

Project showcase by Iron_SalsaStudio

  • 6,031 views
  • 7 comments
  • 11 respects

Playing Smartphone Games with a Relay Touch Board

Project showcase by HomeMadeGarbage

  • 5,690 views
  • 6 comments
  • 11 respects
Add projectSign up / Login