{"id":200,"date":"2019-03-31T20:40:42","date_gmt":"2019-03-31T20:40:42","guid":{"rendered":"https:\/\/dial-a-grue.com\/gory\/?p=200"},"modified":"2019-03-31T20:40:42","modified_gmt":"2019-03-31T20:40:42","slug":"getting-the-keypad-working","status":"publish","type":"post","link":"https:\/\/dial-a-grue.com\/gory\/?p=200","title":{"rendered":"Getting the keypad working."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">So, if I&#8217;m going to have 3 working phones for the Maker faire, I better get to building them.   Today&#8217;s project is to get the keypad working.  Oringally this keypad used a<a href=\"https:\/\/en.wikipedia.org\/wiki\/Dual-tone_multi-frequency_signaling\"> touch-tone signaling mechanism, <\/a>but that wasn&#8217;t necessary for my purposes, so I just cut out all the DTMF hardware to get at the switches that the buttons operate.  There are 12 buttons (3 columns and 4 rows) of numbers and symbols.  The way these keypads operate is that each row and column has it&#8217;s own switch, and each button closes the switch for that column and that row.   I wired each of those switches up to an I\/O line on the raspberry pi 3B that I&#8217;m using as the brains of the Gruebox 1.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1389-1024x768.jpg\" alt=\"\" class=\"wp-image-195\" srcset=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1389-1024x768.jpg 1024w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1389-300x225.jpg 300w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1389-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> In the original phone, each column and row had its own tone, and so each number\/symbol played two tones, hence Dual Tone Multi-Frequency.  I just built a lookup table of switch values that map to symbols\/numbers, and that&#8217;s how I decode which button is pressed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a test run of the decoding:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1391-1024x768.jpg\" alt=\"\" class=\"wp-image-196\" width=\"590\" height=\"443\" srcset=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1391-1024x768.jpg 1024w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1391-300x225.jpg 300w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1391-768x576.jpg 768w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><figcaption>Testing Gruebox1 keypad<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So all 12 buttons work. There is also a switch for the on\/off hook that isn&#8217;t connected yet, so I&#8217;m just wired of off-hook for now, so I can test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I also removed the fake wood-grain sticker on the faceplate.  It&#8217;s still got some residue from the adhesive, but I&#8217;ll take care of that later.  Assembled it looks like:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1392-1-1024x768.jpg\" alt=\"\" class=\"wp-image-199\" srcset=\"https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1392-1-1024x768.jpg 1024w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1392-1-300x225.jpg 300w, https:\/\/dial-a-grue.com\/gory\/wp-content\/uploads\/2019\/03\/IMG-1392-1-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Gruebox 1 keypad assembled and ready to put into the case.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>So, if I&#8217;m going to have 3 working phones for the Maker faire, I better get to building them. Today&#8217;s project is to get the keypad working. Oringally this keypad used a touch-tone signaling mechanism, but that wasn&#8217;t necessary for my purposes, so I just cut out all the DTMF hardware to get at the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,7,8],"tags":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-brains","category-phone","category-wetwork"],"_links":{"self":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":0,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"wp:attachment":[{"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dial-a-grue.com\/gory\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}