/apex5400_bill-acceptor

(Arduino) php bill acceptor/validator (School Project 2019)

Primary LanguageC++MIT LicenseMIT

Apex5400 Bill Acceptor

  • A simple repository for project purposes only.
  • Tested on php paper bill as validator.

Hardware

  • 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)

Getting started

  • Copy this source code to test out your apex5400 bill acceptor

Source code

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