char waitForKey()
This function will wait forever until someone presses a key. Warning: It blocks all other code until a key is pressed. That means no blinking LED's, no LCD screen updates, no nothing with the exception of interrupt routines.
Yeah, it also block all other code. Somehow my lcd works though. Now I'm not sure if I need to use waitForKey(). Most similar examples I've seen used that. Still, the problem seems somewhere in communication between the loops...I guess.
When merging code from void keypadInput() in void loop() program works, but now I'm unable to block number dial if coin amount is not reached.
My latest version of the program should work as follows:
- Insert 1€ or more into the coin acceptor.
- Lcd shows you inserted amount, and informs you when 1€ is reached ("Skambink!")
- Dial a number (1541, 2562 or 3673).
- Hear a sound e.g. jonas.wav
The simpler one works without LCD and coin acceptor (only points 3, 4).