Jump to content


majoris

Member Since 25 Apr 2003
Offline Last Active Feb 14 2019 06:00 pm
*****

Posts I've Made

In Topic: Arduino as pac-drive alternative?

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);
  }
}

In Topic: Arduino as pac-drive alternative?

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


In Topic: Arduino as pac-drive alternative?

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...


In Topic: Arduino as pac-drive alternative?

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!


In Topic: Arduino as pac-drive alternative?

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.