'Bill Acceptor to Raspberry Pi 3 (Python)

I want to connect my Bill Acceptor to the Raspberry Pi 3 and read a pulse. Is there any one who knows or have any idea how to make sure the raspberry pi reads the bill acceptor? Yes i use Python for my code. I used this code but it doesn't work any help here?

Code: 
#!/usr/bin/python
#######
# This program would generate Squence pulse train on GPIO 7 Pin 26 of P1
#######`
import RPi.GPIO as GPIO
from time import sleep
import sys
import signal

def signal_handler(signal, frame):
  print
  GPIO.cleanup()
  sys.exit(0)

def lopper():
  while 1:
    GPIO.output(7,0)
    sleep(0.00025)
    GPIO.output(7,1)
    sleep(0.00025)
    GPIO.output(7,0)
    sleep(0.00005)
    GPIO.output(7,1)
    sleep(0.00025)
    GPIO.output(7,0)
    sleep(0.00065)
    GPIO.output(7,1)
    sleep(0.00025)
    GPIO.output(7,0)
    sleep(0.00045)
    GPIO.output(7,1)
    sleep(0.00005)
    GPIO.output(7,0)
    sleep(0.00025)

GPIO.setmode(GPIO.BCM)
GPIO.setup(7,GPIO.OUT)
signal.signal(signal.SIGINT,signal_handler)
print("Press Ctrl+c to Stop Pulse train")
lopper()
GPIO.cleanup()


Solution 1:[1]

I had the same issue. I found a way to use the MDB protocol for integrating Bill and coin acceptors. I used Qibix MDB hat with raspberry pi 2w, 3, 4, and 4b. You can use these commands to enable and poll the coin and bill acceptors and map these results with bills or coins. Here is a tool chest for testing the acceptors via your PC. You can test and use the same commands with the 'serial' python library on raspberry pi.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Mohsin