Skip to content

Instantly share code, notes, and snippets.

@companje
Created July 13, 2012 23:27
Show Gist options
  • Save companje/3108205 to your computer and use it in GitHub Desktop.
Save companje/3108205 to your computer and use it in GitHub Desktop.
Coin Acceptor Adafruit
#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