New to programming, Coin Acceptor, LCD, Arcade button, LED, and a output.

Hi everyone in the Arduino community!

I'm Eric, I have a project in mind and I have no idea where to start when it comes to coding...

Hardware

Arduino
Coin Acceptor: Coin Acceptor - Programmable (3 coin types) - COM-11719 - SparkFun Electronics
LCD : RGB backlight negative LCD 20x4 + extras [RGB on black] : ID 498 : $24.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Arcade Button with a built in LED
Relay

If someone could help me write up an example piece of code that I can dissect and learn from i'd be extremely grateful.

What I would like to happen

The arcade button to be inactive until 50 cents is received by a user with a max of $1.00. 50 cents would equal 1 arcade button press with $1.00 equaling 2 arcade button presses. When currency is received the buttons Led would then turn on the Lcd back-light would change color from red to green letting the user know its ready for a button press while updating the LCD with that info. When the button is pressed it will activate an output on the arduino EX: Pin 7. once program is done button led will turn off and wait for more currency. I'd also like to add 1 override button if possible to test the system before putting it out in the field.

While this is happening id like it to update the lcd with info regarding the program. for example,

Shooting Gallery
Please insert coins. $0.00

Shooting Gallery
Max Coins Already Inserted.

Shooting Gallery
Shots = 2 $1.00
Fire When Ready

Shooting Gallery
Shots = 1 $0.50
Fire When Ready

Shoot Gallery
Override active
Have Fun!

I plan on doing a small write-up on the project as soon as I get things figured out. If you need more info or have suggestions i'm an open book.

Thank you all in advance.

-Eric G

The arcade button to be inactive until 50 cents is received by a user with a max of $1.00.

No, the switch will not become active or become inactive. It will always be active. The action that happens depends on what action(s) (like depositing coins) have happened already when the switch is found to have become pressed.

When currency is received the buttons Led would then turn on the Lcd back-light would change color from red to green letting the user know its ready for a button press

That is a completely different requirement.

It would be difficult for anyone else to write code for you, not knowing how the switch is wired, where it is connected, what kind of LCD you have, how it is connected, what kind of coin acceptor you have, how it is connected, and what energizing a pin is supposed to accomplish.

Pretty ambitious project for a beginner.

Roger,

Here's some more info on the project.

Hardware

  1. Arduino UNO

  2. Coin Acceptor - Programmable (3 coin types)

  3. Button with LED - 100mm Green

  4. Single Relay Module for Arduino

  5. i2c / SPI character LCD backpack

Arcade Button= Input 7

Arcade Button LED = Output 13

Relay = Output 8

Coin Acceptor = Input 2

12c/SPI Backpack = SCL(A5) SDA(A4)

When currency is inserted the LCD will read back total amount

Example:

Project ScareCAM

INSERT CREDITS $0.00

When Credits are accepted

Project ScareCAM

One Credit $0.50

Project ScareCAM

Two Credits $1.00

FIRE WHEN READY

02 CREDITS

After button is pressed It will trigger the relay for about 500ms Output 8 on Arduino UNO

when max shot(s) reaches zero credits system will revert to

Project ScareCAM

INSERT CREDITS $0.00

The system basically allows you to activate a relay for a max of two presses then reverts back to what i'm going to call "waiting for credits" state.

I know its ambitious, but aren't all things when you first try?

Thanks again for the reply

Kind Regards,

-Eric G