- A simple repository for project purposes only.
- Tested on php paper bill as validator.
- Apex5400 Bill Acceptor
- Arduino Mega
- Lcd Screen
- 4x4 matrix keypad
- x3 Servo sg90
- PVC pipe that fits any coin
- Plastic coin (coz i'm using servo sg90)
- Copy this source code to test out your apex5400 bill acceptor
volatile int pulses = 0;
const byte interruptPin = 2;
boolean displayMe = true;
void setup() {
Serial.begin(9600);
pinMode(interruptPin,INPUT_PULLUP);
attachInterrupt(0,countPulses,CHANGE);
}
void countPulses(){
int val = digitalRead(2);
if(val == LOW){
pulses++;
displayMe = true;
}
}
void loop() {
if(displayMe == true){
Serial.println(pulses);
displayMe = false;
}
}