Hi all!
I’m trying to “hack” an old telephone with a rotary dial.
I already figured out how it works and made a little circuit to feed to my arduino UNO.
The way it works:
I have (only) two wires connected to the Arduino;
1st signal will go LOW when a number is being dialled. (so from the moment you start turning until it
is done, this 1st signal will allways be LOW, otherwise HIGH
the second signal will tell me which number is dialled by pulsing (HIGH to LOW) a number of times.
So if i dial a 4, there will be 4 pulses .
I attached a screenshot from the plotter to give you an idea how this works.
So now, i want to read how many times this has pulsed , so i can process this info and do something with it.
And here is where i find my problem.
Although the plotter shows me that the dial is always pulsing the right amount of times,
the program i wrote is not interpreting this right. (so there must be an error in the coding)
Sometimes i read 5 pulses, then 6, then 3.
I seem to have this problem espacially when i’m trying to read higher numbers. ( Dialling a 9 will almost never result in a 9 )
I attached the small block of code I wrote for this, so you can follow what i’m talking about.
Does ANYONE have an idea how to solve my problem?
thanks in advance,
Lomme
PS: I’m dutch so i used some dutch names for the variables, but it should be readable for anyone
telefoon_extra_test.ino (792 Bytes)