You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • @JumJum,

    you may need to take into account the timings of the dialing life cycle.

    From your first line of the first post I assume that you have an 'old' rotary phone and you want to detect which digits and number it dialed (to drive a touch tone sequence?).

    Remembering how rotary phones worked: when letting the disk go, the loaded spring pulls/rotates the disk it back in rest position with a constant angle speed. Angle speed is controlled - kept 'constant' / preventing from accelerating and running away - by a governor, either centrifugal friction or air resistance governor like they were used in old steam machines and still are used in spring driven music boxes. A combination of a single shot watch and timeouts as as key controls of a timing state machine may make it work:

    1. Initialize pulse counter and timeout handles to 0, and setup the single shot watch.
    2. On firing of single shot:
      • Clear 2nd timeout if it is set and clear the handle ( if (h1) h1 = clearTimeout(h1); )
      • Increment pulse counter.
      • Set 1st timeout to about 60%..80% of the time between pulse begins for re-setup of the single shot watch.
      • Set 2nd timeout to about 120%..140% of the time between pulse begins for detecting the end of pulse sequence.

    This is just the core... some startup and end processing (clear watch and handles). There is most likely another switch that will tell when a dial is about to happen. A watch on that could be used to start the state machine.

    Robust debouncing is a tough thing to do...

    Versuchst du sowas anzuschliessen? Gelb-Gruen: Puls, Weiss-Braun: Ruheposition (?)

    5 Attachments

    • Waehlscheibe.png
    • PTT_TF3_50_1979_front_full.png
    • PTT_TF3_50_1979_schema.png
    • PTT_TF3_50_1979_internals.png
    • D_Post_FeWAp611-1.png

Avatar for allObjects @allObjects started