Jump to content


Photo
* * * * * 2 votes

Arduino as pac-drive alternative?

Arduino pac-drive mamehooker

  • Please log in to reply
185 replies to this topic

#141 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 20 January 2019 - 04:00 PM

thanks, ill be patience

 

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



#142 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 21 January 2019 - 03:48 AM

so in the mean time while eric finds free time to help me out, ive been looking to see if i can solve my problem so i did the test  on a fresh windows 7  computer and got the same results, nothing installed. i know its not the arduino as i have tested some codes to make sure pin 55 outputs voltage or pulses and the relay works just fine. One weird thing is that when i use fruit squeeser if i want to enter a name of a config file, anything that i type, gets erased on the spot, that happens with Fruit Squeezer 0.76.1 but not in Fruit Squeezer 0.76  so Fruit Squeezer 0.76.1 might have a bug maybe? do you mind copy the one you are using and share it to see if it behaves the same way ? im uploading a yutube video but on a slow internet conecction its taking some time.



#143 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 21 January 2019 - 11:12 AM

heres the video showing how fruitsqueeser does not pay and also how the config erases whatever i type on the spot, it happens on windows 7 brand new setup and also on my dayly computer with windows 10 x64. im pretty sure theres something going on with this, no hopper atached just the relay wich is showed at the begining of the video. 




#144 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 21 January 2019 - 02:55 PM

I've checked it on my home computer, and I don't have the issue with erasing config name.

Tomorrow I will try it at work, and some other computers I'll find. This should not happen.

 

I can see other problem on your video. Program lags a lot. Something is wrong. Try to grab Fruit Squeezer window and move it around the screen. Does it move without a problem or hangs from time to time - moving little jerky?

Program led indicators should blink without any delay to emulated game. I can see that everything is moving with a lot of latency.

I will think about it, but the problem is, I've never experienced such behavior of this software... I will think about it.


Logopit_1542465375366.png


#145 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 21 January 2019 - 03:55 PM

I thought about the lag as well, I'll see if I can try on another computer

#146 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 21 January 2019 - 04:52 PM

Lag is a normal thing before MFME is runned. After you run MFME, and it is found by Squeezer lag dissapears, and it should run smoothly. I will think about putting a version which does not need automatic memory scan - lag is side effect of scan process.

 

Maybe I will put back "Squeeze" (scan & connect) button, and we will se how about running this way. Give me some time. I'm very determined to help you, and I think that it will run. One way or another. :)

 

Take care!


Logopit_1542465375366.png


#147 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 21 January 2019 - 05:23 PM

thanks

Lag is a normal thing before MFME is runned. After you run MFME, and it is found by Squeezer lag dissapears, and it should run smoothly. I will think about putting a version which does not need automatic memory scan - lag is side effect of scan process.

 

Maybe I will put back "Squeeze" (scan & connect) button, and we will se how about running this way. Give me some time. I'm very determined to help you, and I think that it will run. One way or another. :)

 

Take care!



#148 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 21 January 2019 - 07:40 PM

I've prepared you changed version. Check PM. And try how it runs with yor computer. You shouldn't experience any lag again. If it will lag again then I give up...


Logopit_1542465375366.png


#149 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 23 January 2019 - 04:11 AM

hey thanks for your effort, sorry it took some time , but i got sick and had to get to the hospital, nothing mayor thanks God, and when i wasnt at home, my little nephew took my relay and now i dont have way to test this on a real hopper, but the lag has went away. Do you believe its the auto squese feature that bugs the software? i believe making this automatic ais a must for cab use. Anyway ,tomorrow ill buy a new relay and test again.


Edited by abispac, 23 January 2019 - 04:12 AM.


#150 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 23 January 2019 - 07:42 AM

Yes, auto scan was meant to be runned on cabinets, when your only worry should be power ON/OFF button. But as it seems doesn't have to work for everyone.

Fruit Squeezer loses some responsiveness during the memory scan. It scans few virtual memory containers for exact singature. When it finds it, then scan is stopped, and responsiveness returns. If MFME does not run, it keeps scanning untill signature is found, and while it is done, we experience major lag.

 

I don't know what caused your lag, because program was hooked to the game. Probably this is going to be unsolved mystery for me. Anyway, I'm glad that changed version works for you - no lag. I wish you get well soon, grab next relay module, and have fun with fruit machine emulation.

 

Take care


Logopit_1542465375366.png


#151 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 23 January 2019 - 10:21 PM

Well if it works for other it should work for me, I'm a try on another computer and see if it works.

Yes, auto scan was meant to be runned on cabinets, when your only worry should be power ON/OFF button. But as it seems doesn't have to work for everyone.
Fruit Squeezer loses some responsiveness during the memory scan. It scans few virtual memory containers for exact singature. When it finds it, then scan is stopped, and responsiveness returns. If MFME does not run, it keeps scanning untill signature is found, and while it is done, we experience major lag.
 
I don't know what caused your lag, because program was hooked to the game. Probably this is going to be unsolved mystery for me. Anyway, I'm glad that changed version works for you - no lag. I wish you get well soon, grab next relay module, and have fun with fruit machine emulation.
 
Take care



#152 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 24 January 2019 - 01:39 AM

ok so i bought me a new relay, and testi it again, no luck with the hopper, however your old code 

void setup() {
  Serial.begin(9600);
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(55, OUTPUT);
}
void loop() {
  while (Serial.available() > 0) {
    int pin = Serial.parseInt();
    int value = Serial.parseInt();
  if (Serial.read() == 'x') {
    digitalWrite(pin, value);
    Serial.println();
    }
  }
}

works just fine with mame and mamehooker. i still got to tweak it a bit and im waiting for eric to help me out in that , but i really really would love to build a donds casino deal or no deal cab, so please majoris dont give up on me, you are on your way to become a good coder, just tell me what to do and ill doit, lets fix this. thanks again ofr your patience and dont let this die.



#153 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 24 January 2019 - 06:10 AM

Excuse my trivial question, but have you used this code for MFME?

#define hopSens 54 //pin wejściowy z sensowa optycznego (dekrementacja licznika hoppera)
#define hopMot 55 //pin wyzwalający zasilania silnika hoppera

void setup() {
  Serial.begin(115200);
  Serial.setTimeout(10);
  pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(14, OUTPUT);
  pinMode(15, OUTPUT);
  pinMode(16, OUTPUT);
  pinMode(17, OUTPUT);
  pinMode(18, OUTPUT);
  pinMode(19, OUTPUT);
  pinMode(20, OUTPUT);
  pinMode(21, OUTPUT);
  pinMode(22, OUTPUT);
  pinMode(23, OUTPUT);
  pinMode(24, OUTPUT);
  pinMode(25, OUTPUT);
  pinMode(26, OUTPUT);
  pinMode(27, OUTPUT);
  pinMode(28, OUTPUT);
  pinMode(29, OUTPUT);
  pinMode(30, OUTPUT);
  pinMode(31, OUTPUT);
  pinMode(32, OUTPUT);
  pinMode(33, OUTPUT);
  pinMode(34, OUTPUT);
  pinMode(35, OUTPUT);
  pinMode(36, OUTPUT);
  pinMode(37, OUTPUT);
  pinMode(38, OUTPUT);
  pinMode(39, OUTPUT);
  pinMode(40, OUTPUT);
  pinMode(41, OUTPUT);
  pinMode(42, OUTPUT);
  pinMode(43, OUTPUT);
  pinMode(44, OUTPUT);
  pinMode(45, OUTPUT);
  pinMode(46, OUTPUT);
  pinMode(47, OUTPUT);
  pinMode(48, OUTPUT);
  pinMode(49, OUTPUT);
  pinMode(50, OUTPUT);
  pinMode(51, OUTPUT);
  pinMode(52, OUTPUT);
  pinMode(53, OUTPUT);
  pinMode(54, INPUT);
  digitalWrite(54, HIGH);
  pinMode(55, OUTPUT);
  pinMode(56, OUTPUT);
  pinMode(57, OUTPUT);
  pinMode(58, OUTPUT);
  pinMode(59, OUTPUT);
  pinMode(60, OUTPUT);
  pinMode(61, OUTPUT);
  pinMode(62, OUTPUT);
  pinMode(63, OUTPUT);
  pinMode(64, OUTPUT);
  pinMode(65, OUTPUT);
  pinMode(66, OUTPUT);
  pinMode(67, OUTPUT);
  pinMode(68, OUTPUT);
  pinMode(69, OUTPUT);
}

int hopStat = 0; //ilość pulsów i tym samym monet do wypłaty
int SensorStat = 0; //aktualny stan sensora - wysoki lub niski
int lastSensorStat = 0; //poprzedni stan sensora - wysoki lub niski

void loop()
{
  SensorStat = digitalRead(hopSens); //przypisanie stanu sensora do pinu podpiętego do sensora hoppera

  if (Serial.available() > 0) //ten cały blok kodu czyta sygnały z seriala x-LEDy, c-monety
  {
    int hopSig = Serial.read();
    if (hopSig == 'c')
    {
      hopStat++;
    }
    int pin = Serial.parseInt();
    int value = Serial.parseInt();

    if (Serial.read() == 'x')
    {
      digitalWrite(pin, value);
    }

	int pinA = Serial.parseInt();
    int valueA = Serial.parseInt();
    if (Serial.read() == 'f')
    {
      analogWrite(pinA, valueA);
    }
  }
  //tu część kodu odpowiedzialna za wypłatę - sterowanie silnikiem i liczenie pulsów sensora
  if (hopStat > 0) //jeśli licznik monet będzie większy od 0, zaczynamy zabawę
  {
    digitalWrite(hopMot, 0); //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, 1);
  }
}

Logopit_1542465375366.png


#154 abispac

abispac

    Newbie

  • Regulars
  • 50 posts

Posted 24 January 2019 - 12:23 PM

yes its the same code, but just in case im a copy end paste this and try again, but that would be in the afternoon as im off to work. thanks majoris.



#155 compuw22d

compuw22d

    Newbie

  • New Members
  • 9 posts

Posted 27 March 2019 - 06:19 PM

I can't seem to get the hopper function to work on any machines I've tried.  The LEDs work great, but the hopper (and counts) never seem to update on the application or get relayed to the Arduino Mega.  Any ideas?  If there was some source code available with some notes I'd be happy to do some poking around myself.  Or maybe describe your personal setup in a bit more detail so I can try and troubleshoot.  I've tried on 2 Windows 10 64-bit machines as well as 1 32-bit Windows 7 machine, a variety of layouts (though admittedly I couldn't find "Dam Buster" to test with).  Totally understand if you'd rather not share the project but if you are and would like to put it up on Github I'd be happy to try and help with this if I'm able (building a machine for my mom's 60th birthday).  Thanks again for all your work so far, this is awesome!



#156 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 28 March 2019 - 07:40 AM

Section IN and OUT of MFME and Fruit Squeezer should match when you run a game. Fruit Squeezer reads memory adresses where those values are stored.

MFME_payout.jpg

 

fruit_squuezer_payout.jpg

 

 

Marked sections should match. If Fruit Squeezer does not show proper values according to running MFME game, then we have a problem with memory reading. Check this out and let me know. Does my program show updated values after changing a game, or putting a coin IN.


Logopit_1542465375366.png


#157 compuw22d

compuw22d

    Newbie

  • New Members
  • 9 posts

Posted 28 March 2019 - 02:37 PM

No, unfortunately the numbers never match.  I've tried a number of different kinds of games for different machines and no luck so far even after dropping in coins, or triggering payouts.  Additionally I'm not able to see all of your extra "debug" boxes but I'm guessing that's by design (.visible set to false and the box resized for your own debugging?)

 

I do have the same issue mentioned before with the incredible lag dragging the window around.  I also have the same issue with the config name being overwritten as typed, and it never "automatically" finds the name of the game and puts it in that box either (though that's not as much of a concern for me).

 

It seems as if a memory scan is done and the LEDs are found (and work) but it's continuing to scan for the hopper number memory locations.  I've gone back and tried older versions as well and nothing appears to be able to grab those memory addresses (though only .76.1 has the lag).  Happy to do anything else I can to help.  I've actually ordered a Pac-Drive as my mom's 60th birthday is this Saturday and I'm building her a cabinet, but unfortunately I don't think it's going to arrive in time so getting this working would be awesome for her party.  Either way this is a huge help to the DIY community.  Awesome job, I know how incredibly close it is to being perfect!



#158 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 28 March 2019 - 03:35 PM

Screenshot I've published is a big SQUEEZEEER, you coud say Fruit Crusher! It runs LEDs, payouts, reel movement on stepper motors and digital display. Everything is at developement stage, so it is disabled for use.

Getting back to topic. I'm totaly cofused with your description of problem. At the the beginning I had some idea for solution, but after further reading I've lost hope for quick help. I've never had similar problem and I have no idea how to reproduce such situation at my setup.

But I'm guessing that might be a problem with memory scan. I have some idea.

Anyway, it will be safer for you if you stick to Pac Drive. It is well tested solution and directly implemented in MFME. My Arduino solution is just alternative, and very imperfect as it seems.

I will write you a PM.

If you're interrested on doing some investigation we could try to hadle it together.


Logopit_1542465375366.png


#159 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 29 March 2019 - 06:09 AM

The problem is solved.

Fruit Squeezer is working (confirmed). With a help of User compuw22d we have done small investigation. I've located a problem. Now hopper payment issue should be no problem any more. I was able to reproduce error spotted by abispac user, as well as compuw22d. It was the same issue.

In next post I will publish Fruit Squeezer with correction.


Logopit_1542465375366.png


#160 majoris

majoris

    Fruit Squeezer

  • Regulars
  • 85 posts

Posted 31 March 2019 - 01:57 PM

Update to Fruit Squeezer.

Working version. Please use latest MFME 6.1.0.363.

http://www.desertisl.../file/116-mfme/

 

Everything is stored in one archive.

You will find:

- Fruit Squeezer main program

- Arduino code

- system dll's (thanx Eric)

- info graphics (Arduino Mega pinouts, LED and hopper connections)

 

Enjoy.

 

ps. 1

In case of any problems please inform me. I'll try to help.

ps. 2

Blog will be available soon. Work in progress.

Attached Files


Logopit_1542465375366.png






Also tagged with one or more of these keywords: Arduino, pac-drive, mamehooker

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users