poxkix
Member level 5
The coin selector has no datasheet. So this is totally unknown to me.
It has 5 wires.
RED - 12v supply
BLACK - ground
GRAY (2) - counter +/-
WHITE - data/signal
My current logic:
The white wire will give a data/signal if a coin has been inserted.
This is the code in detecting the data/signal:
These are the things that I already tried to do:
1. connecting the WHITE wire directly to PORTA.F0, what happens the code executes even though there is no coin inserted.
2. I tried inverting the WHITE wire using the 7404, thinking that the WHITE wire gives a default data/signal of 1. It still gives the same result.
3. I tried using a transistor 2222A. Now, the code will not directly execute. If I insert a first coin, it executes but when the second is inserted nothing will happen. (the code should detect 2 coins inserted then it exits)
These is what the coin selector looks like:
It has 5 wires.
RED - 12v supply
BLACK - ground
GRAY (2) - counter +/-
WHITE - data/signal
My current logic:
The white wire will give a data/signal if a coin has been inserted.
This is the code in detecting the data/signal:
Code:
coin_count = 2;
while(coin_count > 0) {
while(PORTA.F0 != 1) {
srand(seed++);
}
if(PORTA.F0 == 1) {
coin_count = coin_count - 1;
}
if(coin_count == 1) {
Lcd_Custom_Out(3,13,"05");
}
}
These are the things that I already tried to do:
1. connecting the WHITE wire directly to PORTA.F0, what happens the code executes even though there is no coin inserted.
2. I tried inverting the WHITE wire using the 7404, thinking that the WHITE wire gives a default data/signal of 1. It still gives the same result.
3. I tried using a transistor 2222A. Now, the code will not directly execute. If I insert a first coin, it executes but when the second is inserted nothing will happen. (the code should detect 2 coins inserted then it exits)
These is what the coin selector looks like: