Arduino as pac-drive alternative?
Started by majoris, Mar 27 2018 09:11 PM
Arduino pac-drive mamehooker
185 replies to this topic
#121
Posted 16 January 2019 - 02:13 PM
Thanks I got me a better idea now, I was confused on pins and grounds
#122
Posted 17 January 2019 - 02:22 AM
Ok so i failed one more time but im gonna keep trying until i succeed.
Anyway i think this hoppers work a bit diferent, so maybe you can help me modify your code to suit my needs.
This hoppers have a sensor for the coin out, this sensor its always on and when the coin passes by it turns itself off and sends a pulse (maybe a fast 5v? i dont have a multimeter to check that) in your diagram it says that i should conect this to pin 54 wich i believe its a listener right? so far so good, now pin 55 should go to motor trigger, now in my arduino ,with your code, it looks like pin 55 its always on, wich causes my motor to turn on and spit all the coins, so i wonder if pin 55 should be off and be turned on once MFME pays coins, and turn it off once pin 54 receives the signal that X amounts of coins have been paid? am i right?
I say all this because, if i conect everything the way your schematic tells me to do it, my motor its always on, even if i just conect a led light, the light its on.
Thanks for any help.
#123
Posted 17 January 2019 - 06:33 AM
if (hopStat > 0) //jeśli licznik monet będzie większy od 0, zaczynamy zabawę { digitalWrite(hopMot, 1); //włączamy silnik hoppera i tym samym całe jego zasilanie if (SensorStat != lastSensorStat) //jeśli stan sensora jest inny od poprzedniego stanu, wchodzimy w warunek { if (SensorStat == 1) //podniesione ramię sensora daje niski stan, gdy to nastąpi wchodzimy w warunek { hopStat--; //zmniejszamy o 1 stan licznika monet } lastSensorStat = SensorStat; //zapamiętujemy aktualny stan sensora do następnego przebiegu programu } } else { digitalWrite(hopMot, 0); } }
Here you go. Code is changed at hopMot command. 0 to 1, and 1 to 0. I put only the last part of the code. Exchange this part in the sketch and compile it.
#124
Posted 17 January 2019 - 03:22 PM
Thanks I'll test and post results
#125
Posted 18 January 2019 - 12:15 PM
no succes, im gonna keep trying, today ill buy a regural 5v relay as the one in the picture and test with the old and the new code and ill post results. Ill do this because this type of hoppers should be able to work right as they work really nice in some real fruit machines, thanks for the help.
i got one more question, do i need to do somethinf in order for mfme to recognise the arduino as a hopper or is it automatic as the leds?
#126
Posted 19 January 2019 - 05:37 AM
So no luck still, and im pretty sure i got everything conected as it should, so heres what i did;
first, the new code gave me on status on the hopper motor still, so i decide to buy me a relay and start over.
So i bought this relay
so the way i got everything set up is
pin 54 goes to hopper sensor
pin 55 is a motor trigger so i connected that to the relay IN, ,
ground from arduino goes to ground in relay and into hoppers power source ground,
and 5v from arduino goes to relay vcc
hopper 12v goes to NO and COM on relay (i imagine that when pin 55 triggers it should close that and start the motor)
it should work right? so i fire up fruit squezer first,
then MFME 6.1, load Donds casino, play a few games, lamps apear to work everything looks good,
when i win a round i press the collect button but nothing happens.
i have tested the relay and it works just fine, it seems to me that fruitsquezer its not catching the payouts as the payout counters stays at 0.
i have tried to modify the hopper sch to 2,3 or 5 and still the same result.
at the pacdrive options my options are just like they load by default.
at this point any help would be apreciated, thanks alot.
heres a bad sketch of my setup
Attached Files
#128
Posted 19 January 2019 - 04:06 PM
tested my setup with this code just to make sure it works, and it works just fine
// Arduino Relay Control Code
#define relay A0
#define interval 1000
#define interval 1000
void setup() {
pinMode(relay, OUTPUT);
}
pinMode(relay, OUTPUT);
}
void loop()
{
digitalWrite(relay, HIGH);
delay(interval);
digitalWrite(relay, LOW);
delay(interval);
}
{
digitalWrite(relay, HIGH);
delay(interval);
digitalWrite(relay, LOW);
delay(interval);
}
#129
Posted 19 January 2019 - 04:09 PM
i use a1 instead of a 0 that was the original code, sorry but i still cat edit my post
// Arduino Relay Control Code
#define relay A1
#define interval 1000
#define interval 1000
void setup() {
pinMode(relay, OUTPUT);
}
pinMode(relay, OUTPUT);
}
void loop()
{
digitalWrite(relay, HIGH);
delay(interval);
digitalWrite(relay, LOW);
delay(interval);
}
{
digitalWrite(relay, HIGH);
delay(interval);
digitalWrite(relay, LOW);
delay(interval);
}
#130
Posted 19 January 2019 - 07:36 PM
I've checked again my setup and it works fine. Try to use unmodified Arduino code. I've tested it without hopper connected, but my relay clicks on payout, so it seems working. Fruit Squeezer sends proper commands to Arduino as it seems. Sometimes first coin is not paid out, I don't know why. But it happens only after reset of all setup. After some play it does not happen again.
My current connection:
Relay VCC to Arduino 5V
Relay IN to Arduino A1
Relay GND to Arduino GND
Works.
I haven't checked payout signals, only motor relay.
#131
Posted 19 January 2019 - 07:57 PM
my setup with the code itself, works just fine to now that im using a relay, i hear clicks on the relay, but payouts are not working, thats point of having a hopper isnt it? i thought you guys had everything figured out, or is it just theory? what game rom are you using? can you share it so i can test with it to, thanks for your patience and help. as you mentioned "I haven't checked payout signals, only motor relay." that means it might not be working on your setup as well, as the way it should work (on my tipe of hopper) is that motor should stay on, not clicking, and arduino should be waiting for the amount of coins paid out pulses on pin 54 and tell pin 55 to turn off,am i right?
I've checked again my setup and it works fine. Try to use unmodified Arduino code. I've tested it without hopper connected, but my relay clicks on payout, so it seems working. Fruit Squeezer sends proper commands to Arduino as it seems. Sometimes first coin is not paid out, I don't know why. But it happens only after reset of all setup. After some play it does not happen again.
My current connection:
Relay VCC to Arduino 5V
Relay IN to Arduino A1
Relay GND to Arduino GND
Works.
I haven't checked payout signals, only motor relay.
#133
Posted 19 January 2019 - 08:41 PM
I missed one of your questions. Sorry.
Well, after Arduino receives payout signal from Fruit Squeezer it triggers motor Pin. This pin stays triggered as long, as payout counter in Arduino is greater than zero. This counter is decremented by pulses received on pin 54. Those pulses come from the hopper. If no signal comes from the hopper, pin 55 will stay triggerred, causing your relay to be ON for this time.
The problem with this solution is that I've tested everything on one type of hopper - Cube Hopper. If I had a chance to test other hoppers, it would be easier to help.
#135
Posted 19 January 2019 - 09:00 PM
still no luck, i wonder if is because this is running on windows 10 x64, im a try on windows 7x86 and post results.
#136
Posted 19 January 2019 - 09:50 PM
No. I'm running it on Win10 as well so this is not a problem.
Try without a hopper connected. Use Arduino and relay module only. Upload Adruino code, and run Arduino Serial Monitor. Without Fruit Squeezer & MFME now.
Try typing "c" char to the monitor. This is the signal ('c' char) sent by Fruit Squeezer to Arduino to increase payout counter. See the reaction of relay module.
After first c, you should get no effect (small issue to solve). Second c should trigger the relay module. After it is triggered try to ground pin 54. Relay module should turn off.
#137
Posted 19 January 2019 - 10:50 PM
nothing at all looks like the mointor its not catching anything, i see if i can upload a video , also im a try this on a brend new formated pc
#138
Posted 19 January 2019 - 10:55 PM
too bad i stil cant edit my posts so i have to double post sorry, i wanted to say that i have tested the arduino with code for relay timers and it works, for relay on and of in betwen 1 second timelapse and it worked, also i have tested this with mamehooker and it works, is just does not work wiith fruit squezeer and mfme.
#139
Posted 19 January 2019 - 11:22 PM
Too bad. But if you dont get any response even on plain serial monitor on Arduino IDE, then there is no problem with Squeezer or MFME, but somwhere else. Your Arduino must be able to catch char 'c' typed manualy from the keyboard and sent to the Arduino device. If you properly uploaded my Arduino code, and working on proper and opened com port, then you shoud get it working. If not, then I have no idea where to look for problem and how to help. I don't think that plain system would help.
All setup was working as shown on my previous videos, so it works not only in theory. I got it running.
#140
Posted 20 January 2019 - 08:19 AM
Hi Abiscap,
I can help you, i have the solution for igrosoft but if you can wait a week because i have a lot of work.
Majoris is the professor
Thank
Eric
Also tagged with one or more of these keywords: Arduino, pac-drive, mamehooker
Fruit Emu Emulation Section →
MFME emulation section →
Cabinet Building →
Stepper motor control signalStarted by majoris, 27 Mar 2018 stepper motor, reels, cabinet and 2 more... |
|
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users