I'm new to Arduino and programming. I'm trying to make a coin counter with a coin acceptor and display the total amount on an LCD. I copied someone else's code and it works, the only problem is, They use Pounds instead of US Cents. I was able to get the right value for each coin but for example, 1Cent displays as 1.00 instead of .1
I was able to get it to display without the decimal so it would show just 1 but after it reaches $1 it displays it as 100 instead of 1.00 It's driving me crazy. any help is greatly appreciated.
I tried that. when I change the value, the LCD shows 0.00 when i put coins in.
for some reason His values are 1, 2, 5, 10, 10 but all the US coins match. the only problem is the position of the decimal point on the display. I've even tried playing around with the Set Cursor position with no luck.
And yes that's the exact code I used
You are correct. They use dollar coins or "pounds' I believe. But I'm trying to convert it to Cents. it wont let me change the coin value. if I change it the display shows 0.00 for every coin
Put your cursor after one of the values in that array and press delete until it is gone. Then type in the decimal value that is appropriate. Repeat for each of the coin values in the array.
I don't have the hardware for testing, but structurally it's missing a way to detect which pulse code matches which coin.
It looks like this code might have been copied from something else that scanned through the different coin types, and maybe you could find that somewhere.
Either that or start over. Maybe expand your interrupt to record the time of the last trigger, and then you could just use impulsCount directly, like these completely untested snippets:
And if you want more help, maybe edit your post to make the code be fully within the code tags, and edit the title to something useful and non-generic like: