Arduino Hack Slot Machine

Posted on  by 

  1. Arduino Hack Slot Machine Games

Hey guys, been doing one of the project in instructables w/c is this
https://www.instructables.com/id/Make-Money-with-Arduino/
Interfacing a Coin Slot to a Arduino. Read and done the instructions provided in the project. But there seems to be a problem bec. i can't seem to get the desired output.
I have a Coin Slot w/c was already set to 3 different types of coins (P1, P5.00, P10.00)(Philippine Coins)
Set it up according to the instructions of the project, 'COIN' white wire connected to pin2 (interrupt pin 0) of the arduino, common ground connection of the arduino and the coin slot (12V), and for an easy way to see the output i put up 3 LEDs on pin8, pin9, and pin10.
This is the code i used, (modified)(original comments still there)
--
const int coinInt = 0;
//Attach coinInt to Interrupt Pin 0 (Digital Pin 2). Pin 3 = Interrpt Pin 1.
volatile float coinsValue = 0.00;
//Set the coinsValue to a Volatile float
//Volatile as this variable changes any time the Interrupt is triggered
int coinsChange = 0;
int OneLed = 8;
int FiveLed = 9;
int TenLed = 10;

//A Coin has been inserted flag
void setup()
{

pinMode(OneLed, OUTPUT);
pinMode(FiveLed, OUTPUT);
pinMode(TenLed, OUTPUT);

Serial.begin(9600);
//Start Serial Communication

attachInterrupt(coinInt, coinInserted, RISING);

//If coinInt goes HIGH (a Pulse), call the coinInserted function
//An attachInterrupt will always trigger, even if your using delays
}
void coinInserted()
//The function that is called every time it recieves a pulse
{
coinsValue = coinsValue + 1;

//As we set the Pulse to represent 5p or 5c we add this to the coinsValue
coinsChange = 1;
//Flag that there has been a coin inserted
}
void loop()
{
if(coinsChange 1)

//Check if a coin has been Inserted
{
if (coinsValue 1)
{
digitalWrite(OneLed, HIGH);
delay(1000);
digitalWrite(OneLed, LOW);
}
else if (coinsValue 5)
{
digitalWrite(FiveLed, HIGH);
delay(1000);
digitalWrite(FiveLed, LOW);
}
else if (coinsValue 10)
{
digitalWrite(TenLed, HIGH);
delay(1000);
digitalWrite(TenLed, LOW);
}

//Print the Value of coins inserted
coinsChange = 0;
}
}

--
Rather than using microsoft express, i wanted to use simple LEDs on pin8, pin9, and pin10 to indicate if the program read the input correctly.
after doing the wiring, and coding in the arduino, i tested to see if it would work.
NONE of the LEDs light up after inserting coins on the coinslot.
Need Help! :X

Hack

Arduino Hack Slot Machine Games

Slot Machine Hack January 31, 2017 This project was commissioned by our partners State of the Art for the 85 years exhibition of Casino Estoril opening that took place on the 23rd of November 2016, and is still running until the 12th of February 2017. Pin 1 - RTS on the FTDI USB to Serial break out board, reset button. Pin 2 - TXD on the FTDI USB to Serial break out board. Pin 3 - RXD on the FTDI USB to Serial break out board. Pin 4 - 1K ohm resistor - momentary 'spin' button. Pin 5 - 330 ohm resistor - RGB LED blue pin. Pin 6 - unused, consider grounding it.

Coments are closed