need help ASAP with simple code! - Thanks - sorted though!

I know a little bit of simple coding on arduino and other… but I am VERY rusty on it at the moment!
I have less than a week to fit a system to my Virtual Reality machine before it is due at an event!

To say what its for is a little long winded - but here goes.
My VR machine is powered by an Amiga 3000 - but its parallel port is faulty.
The P.port controls various items that I have managed to bypass - but one important item I cannot: When the game starts, the voltage regulator is pumped up from 5v to 9v - to brighten the screens during play.

Its very simple (I think)
Ok - its simple as I say…

Part one :
Simple timer program…
When a button (microswitch) is pressed , a timer is started - (of which Ill work out the game time soon). During the timer count down (ie 3mins to 0:00), I need an output to send 4v to the voltage regulator to boost it (Ill sort that bit)
I assume, I`ll need to output via a transistor in order to power the voltage reg ?

So thats just a simple timer program.

Now Part two: (not as important - but still would like)

There are two lights on the system that I would like to flash or be on…
Light one - Insert Credit flashes until its pressed.
Light two - Start Game is off until credit is inserted - then it starts to flash.
When Start Game is pressed, both lights are on.
Once the game ends (designated by the timer above), Start game goes off, and Insert Credit flashes.

Now I know it sounds lazy of me, but what I`m asking is can someone just please write the code for me as I dont have time to research! it.
I have less than a week! (well more than - but I cant work on it every day as the machine is not at home)

can someone PLEASE HELP!



Now I know it sounds lazy of me, but what I`m asking is can someone just please write the code for me as I dont have time to research! it

Since you're asking for someone to write the code for you, you've posted in the wrong section of the forums. You should have posted in the "Gigs and Collaborations" section, but be prepared to pay someone.

Click on "Report to moderator", and ask to have the thread moved.


To simplify, I think you're looking for:

  1. A countdown timer that starts when a switch is pressed. An output line is held high during the countdown.

  2. A state machine that manages the insert coin, start, and run to end behavior, all managed with a few switches. The SW drives two output lines that drive the lights.

  3. I assume you'll need another line that indicates that the user has pressed 'start' to initiate the game?


I have tried to code it myself. Please see attached.

after googling more on keywords and stuff… It all slowly started to come back to me…

I have used the Blink with no Delay code to flash the lights

And got it to read the button presses
Once INSERT CREDIT goes HIGH, it checks for when START GAME goes HIGH

When both are HIGH, sets output to HIGH and then simply delays for the Game time - then resets it all for the next loop.

It all verifies ok - but I dont actually have an arduino to hand to test it!

SD_timer.ino (2.59 KB)

See PM

Hey all
I got it working! Thanks


Hi Simon,

Good luck with the VR event!


Hi all,

Code worked fine - after a slight mod:

int GameTime = 235;
long s = GameTime*1000;
would not work as it complained that the second line was in error.

but it was the first one! - I needed GameTime to be a long too!

Anyway - after all the work.. the idea failed....
The two buttons - Insert Credit and Start Game, although microswitches, are basically wired direct into a keyboard, for F1 & F10.
The Arduino required a common GND for the switches - that I could not do with the keyboard.

I went too far in fitting the arduino to the machine to revert it back, so I took all the button section off - for the weekend event, I`ll just use a keyboard F1 & F10.

I have a new idea though - let the Arduino feed the keyboard presses via a relay or something - But I dont have time to implement that before Friday.

So I`ll sort that after the event!

Thanks all

And if you are interested in the Event - its Play Expo in Manchester UK.
And my VR machines can been seen on facebook - on both RetroVR and Retro Computer Museum - both based in Leicester UK.