So I am TRYING to help our local photographic museum,
with a little fundraiser for their self portrait exhibition starting a mere 13 days from now.
They want to have a photobooth as a fundraiser, which is easy enough for me to supply, I am a professional photographer who has a photobooth.
However they want to have it act as an automatic vending machine.
I have bought a program that controls my photobooth, but the vending section of code is not yet complete.
All I need to do is have my dollar bill acceptor write a number "1" to a text or dat file so the program can know how many dollars have been inserted. As more dollars are inserted the machine simply adds the numbers up. Two dollars would write the number 2 to the text file. Sounds easy enough?
The manufacturer of the bill acceptor has posted free qbasic code on their website:
I downloaded quickBasic 4.5
from:
Extract it and there is a file called QB.exe that runs quickbasic.
Next I created a *.bas file in the same directory that Qbasic is located in and called it money.bas using the following code
code:
OPEN "com1: 300, n, 8, 1,cd0,cs0,ds0,op0,rs,rb2048" FOR INPUT AS #1
OPEN "c:\photoboof\credits.txt FOR OUTPUT AS #2
PRINT #2, 0
CLOSE #2
OPEN "c:\photoboof\credits.txt" FOR OUTPUT AS #2
delay = 0
COLOR 15, 1, 1
CLS
PRINT " Please insert $1 BILLS FOR PHOTOS"
PRINT
PRINT " When you are done inserting all of your bills, press any key to continue..."
LOCATE 5, 35
PRINT "Credit: $"; credit
ON COM(1) GOSUB getbill
COM(1) ON
credit = 0
OUT &H3F8, 1
DO WHILE INKEY$ = ""
LOOP
OUT &H3F8, 0
REM PRINT "Total Credit: "; credit
PRINT #2, credit
CLOSE
REM DO WHILE INKEY$ = "": LOOP
REM stop
SYSTEM
getbill:
REM PRINT HEX$(ASC(INPUT$(1, 1)))
credit = credit + 1
LOCATE 5, 35
PRINT "Credit: $"; credit
RETURN
Now I opened up the QB.exe program and open up the money.bas file in it.
Hit F5 and the program should runs.
I am attatching my serial based Bill Acceptor, model. # coinco ba30b to my computer using this device:
Note the Bill Acceptor will NOT function until you run the above quickbasic program which activates the com port and sets the voltage correctly to activate the bill acceptor.
The major issue is I have three of these bill acceptors and two adapter cables and the machines simply do not give the customer a credit when money is inserted. I think it changed the credit file from 0 to 1, once the very first time I tried it, but never since and I have tried this on 3 different PC's.
I am beginning to think something is wrong with the serial com comamnds in my source code? the bill collector can be set to receive short pulses 50 or standard 150ms on/off pulses, any recommendations?
with a little fundraiser for their self portrait exhibition starting a mere 13 days from now.
They want to have a photobooth as a fundraiser, which is easy enough for me to supply, I am a professional photographer who has a photobooth.
However they want to have it act as an automatic vending machine.
I have bought a program that controls my photobooth, but the vending section of code is not yet complete.
All I need to do is have my dollar bill acceptor write a number "1" to a text or dat file so the program can know how many dollars have been inserted. As more dollars are inserted the machine simply adds the numbers up. Two dollars would write the number 2 to the text file. Sounds easy enough?
The manufacturer of the bill acceptor has posted free qbasic code on their website:
I downloaded quickBasic 4.5
from:
Extract it and there is a file called QB.exe that runs quickbasic.
Next I created a *.bas file in the same directory that Qbasic is located in and called it money.bas using the following code
code:
OPEN "com1: 300, n, 8, 1,cd0,cs0,ds0,op0,rs,rb2048" FOR INPUT AS #1
OPEN "c:\photoboof\credits.txt FOR OUTPUT AS #2
PRINT #2, 0
CLOSE #2
OPEN "c:\photoboof\credits.txt" FOR OUTPUT AS #2
delay = 0
COLOR 15, 1, 1
CLS
PRINT " Please insert $1 BILLS FOR PHOTOS"
PRINT " When you are done inserting all of your bills, press any key to continue..."
LOCATE 5, 35
PRINT "Credit: $"; credit
ON COM(1) GOSUB getbill
COM(1) ON
credit = 0
OUT &H3F8, 1
DO WHILE INKEY$ = ""
LOOP
OUT &H3F8, 0
REM PRINT "Total Credit: "; credit
PRINT #2, credit
CLOSE
REM DO WHILE INKEY$ = "": LOOP
REM stop
SYSTEM
getbill:
REM PRINT HEX$(ASC(INPUT$(1, 1)))
credit = credit + 1
LOCATE 5, 35
PRINT "Credit: $"; credit
RETURN
Now I opened up the QB.exe program and open up the money.bas file in it.
Hit F5 and the program should runs.
I am attatching my serial based Bill Acceptor, model. # coinco ba30b to my computer using this device:
Note the Bill Acceptor will NOT function until you run the above quickbasic program which activates the com port and sets the voltage correctly to activate the bill acceptor.
The major issue is I have three of these bill acceptors and two adapter cables and the machines simply do not give the customer a credit when money is inserted. I think it changed the credit file from 0 to 1, once the very first time I tried it, but never since and I have tried this on 3 different PC's.
I am beginning to think something is wrong with the serial com comamnds in my source code? the bill collector can be set to receive short pulses 50 or standard 150ms on/off pulses, any recommendations?