Last active
August 29, 2015 14:13
-
-
Save ArthurGuy/bd91e6b8f675fff61cd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pin3 = 2; //£1 | |
int pin4 = 3; //£2 | |
int pin5 = 4; //input - coin return | |
int pin6 = 5; //high - stops money | |
int pin7 = 6; //5p | |
int pin8 = 7; //10p | |
int pin9 = 8; //20p | |
int pin10 = 9;//50p | |
void setup() { | |
pinMode(pin3, INPUT_PULLUP); | |
pinMode(pin4, INPUT_PULLUP); | |
pinMode(pin5, INPUT_PULLUP); | |
pinMode(pin6, OUTPUT); | |
pinMode(pin7, INPUT_PULLUP); | |
pinMode(pin8, INPUT_PULLUP); | |
pinMode(pin9, INPUT_PULLUP); | |
pinMode(pin10, INPUT_PULLUP); | |
Serial.begin(9600); | |
} | |
void loop() { | |
//digitalWrite(pin6, true); | |
if (!digitalRead(pin3)) { | |
Serial.println("£1"); | |
} | |
if (!digitalRead(pin4)) { | |
Serial.println("£2"); | |
} | |
if (!digitalRead(pin5)) { | |
Serial.println("Reset"); | |
} | |
if (digitalRead(pin6)) { | |
//Serial.println("PIN6"); | |
} | |
if (!digitalRead(pin7)) { | |
Serial.println("5p"); | |
} | |
if (!digitalRead(pin8)) { | |
Serial.println("10p"); | |
} | |
if (!digitalRead(pin9)) { | |
Serial.println("20p"); | |
} | |
if (!digitalRead(pin10)) { | |
Serial.println("50p"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment