Created
July 13, 2012 23:27
-
-
Save companje/3108205 to your computer and use it in GitHub Desktop.
Coin Acceptor Adafruit
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
#include <LCD4Bit_mod.h> | |
LCD4Bit_mod lcd = LCD4Bit_mod(2); | |
int geld=0; | |
void setup() { | |
lcd.init(); | |
lcd.clear(); | |
lcd.printIn("Gooi geld in aub"); | |
pinMode(2,INPUT); | |
} | |
void loop() { | |
if (digitalRead(2)) { | |
geld++; | |
//geld omzetten naar tekst | |
char tekst[10]; | |
sprintf(tekst, "%d euro",geld); | |
lcd.cursorTo(2,0); | |
lcd.printIn(tekst); | |
} | |
} //end loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment