Coin types and pulse values
You choose how many pulses each coin sends, and that one choice decides what your sketch can work out. Proportional counts let it add up money by itself. Low counts are faster but mean nothing on their own.
Getting into the menu
Hold + and − together for about two seconds. The display shows E.
- Press + to choose how many coin types you want, up to six. Press SET.
- The display shows
P1. Set the pulse value for your first coin with + and −, then press SET. P2, thenP3, and so on for as many types as you asked for.- When the last one is saved the display returns to
E.
P1 is the first coin type, P2 the second. Which physical coin each one
refers to is decided later, in training — P1 is whichever coin you feed at
step A1.
The decision hiding in that menu
The pulse value is not a label. It is the only thing that leaves the acceptor about which coin went in, and the numbers you pick decide what a sketch can do with them.
Both plans in that figure are the product's own documentation. The library's own value-mode example uses the proportional one; the printed quick-start guide recommends the low counts. They are not the same advice, and neither is wrong — they are for different modes.
Proportional: the money adds up on its own
Pick a unit — five cents is a good one — and set each coin to that many units.
| Coin | Pulses |
|---|---|
| 5c | 1 |
| 10c | 2 |
| 25c | 5 |
| $1 | 20 |
Now a sketch can add five cents for every pulse it counts and never need to know which coin it was. That is what value mode does, and it is the only arrangement in which its total is trustworthy.
The cost is at the bottom of the table. A dollar is twenty pulses, which at Medium is about a second on the wire.
Low counts: fast, but the arithmetic is gone
| Coin | Pulses |
|---|---|
| 5c | 1 |
| 25c | 3 |
| $1 | 5 |
The biggest coin now arrives in a quarter of a second, so coins can follow each other much more closely. But three pulses is not worth fifteen cents in any system — the counts have become names, and the sketch has to be told what each name means. That is mapped mode, and three modes is where the two are compared.
Use whole numbers
Work in cents, not dollars. Every total the library keeps is an unsigned
integer, so setPulseValue(0.05) truncates to zero, which the library rejects
— and rejecting it quietly leaves the default of one in place, so every pulse
counts as a single unit and your total is a pulse count wearing a dollar sign.
Five is the number to set.
When it does not work
E is the resting state inside setup mode, and it is where you land between steps. From E, SET goes into training. To set pulse values you need to get into setup from the start: hold + and − together for two seconds. If the buttons genuinely do nothing, check the adapter — a sagging rail resets the acceptor's own computer.
The pulse plan is not proportional, and the sketch is in value mode. Value mode multiplies pulses by a fixed rate; if 25 cents is set to 3 pulses at 5 cents a pulse, it will report 15. Either reprogram the coins proportionally or switch the sketch to mapped mode.
Then nothing anywhere can tell them apart — the count is the only information on the wire. The library refuses a duplicate: addCoin() returns false for a pulse count it already has, and begin() fails if no coin was added at all. Give each coin its own count.
The acceptor will let you set counts higher than is sensible. The library refuses to map a coin above 50 pulses — addCoin() returns false and that coin is simply never recognised. At Medium, 50 pulses is two and a half seconds for one coin, which is already far past usable anyway.
Fifteen of each, and what the display says while you count them.
Train it with real coins →Edit this page — content/books/coin-acceptor/coin-types-and-pulse-values.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Arcade Coin Acceptor Module Kit, USB-C Powered
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.