{"id":1410,"date":"2024-06-04T08:00:00","date_gmt":"2024-06-04T06:00:00","guid":{"rendered":"https:\/\/www.fuhselab.de\/?p=1410"},"modified":"2025-05-27T13:17:58","modified_gmt":"2025-05-27T11:17:58","slug":"arduino-tastenfeld-3","status":"publish","type":"post","link":"https:\/\/www.fuhselab.de\/index.php\/2024\/06\/04\/arduino-tastenfeld-3\/","title":{"rendered":"Arduino Tastenfeld 3"},"content":{"rendered":"\n<p>Es geht mit Tastenfeldern weiter. Das Tastenfeld wird mit einer LED-Schaltung verbunden. Statt Infomeldungen im seriellen Monitor auszugeben, soll bei richtiger PIN eine gr\u00fcne LED leuchten und bei falscher PIN eine rote LED&#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Tastenfeld mit LED Schaltung:<\/strong><\/p>\n\n\n\n<p>Der Aufbau der LED Schaltung sollte aus den vergangenen Webartikeln zum Thema LED bereits klar sein und ergibt sich aus aus dem Code f\u00fcr dieses Projekt.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Keypad.h&gt;\nconst byte ROWS = 4;\nconst byte COLS = 3;\n\nchar keys&#91;ROWS]&#91;COLS] =\n{\n {'1','2','3'},\n {'4','5','6'},\n {'7','8','9'},\n {'*','0','#'}\n};\n\nbyte rowPins&#91;ROWS] = {5,6,7,8};\nbyte colPins&#91;COLS] = {2,3,4};\nKeypad keypad = Keypad (makeKeymap(keys), rowPins, colPins, ROWS, COLS );\n\n\/\/ Ende des erforderlichen Codes\n\nint led01=13;\nint led02=12;\n\nvoid setup()\n\n{\nSerial.begin (9600);\npinMode(led01, OUTPUT);\npinMode(led02, OUTPUT);\n}\n\n\nvoid loop()\n{\nchar key = keypad.getKey();\n\n\nif (key == '1')\n{\ndigitalWrite(13, HIGH);\ndigitalWrite(12, LOW);\n}\n\nif (key == '2')\n{\ndigitalWrite(13, LOW);\ndigitalWrite(12, HIGH);\n}\n\nif (key == '3')\n{\ndigitalWrite(13, HIGH);\ndigitalWrite(12, HIGH);\n}\n\nif (key == '4')\n{\ndigitalWrite(13, HIGH);\ndelay(100);\ndigitalWrite(13, LOW);\ndelay(100);\ndigitalWrite(12, LOW);\n}\n\nif (key == '5')\n{\ndigitalWrite(13, LOW);\ndigitalWrite(12, HIGH);\ndelay(100);\ndigitalWrite(12, LOW);\n}\n}<\/code><\/pre>\n\n\n\n<p>Weitere interessante Webartikel zum Thema Arduino gibt es auf der <a href=\"https:\/\/www.fuhselab.de\/index.php\/category\/arduino\/\">Fuhselab<\/a> Webseite und in der <a href=\"https:\/\/www.fuhselab.de\/index.php\/2023\/08\/24\/fuhselab-artikeluebersicht\/\">Artikel\u00fcbersicht 2022<\/a> und der <a href=\"https:\/\/www.fuhselab.de\/index.php\/2023\/12\/19\/artikeluebersicht-2023\/\">Artikel\u00fcbersicht 2023<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Es geht mit Tastenfeldern weiter. Das Tastenfeld wird mit einer LED-Schaltung verbunden. Statt Infomeldungen im seriellen Monitor auszugeben, soll bei richtiger PIN eine gr\u00fcne LED leuchten und bei falscher PIN eine rote LED&#8230;<\/p>\n","protected":false},"author":1,"featured_media":48,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[22],"class_list":["post-1410","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","tag-arduino-gruppe-peine"],"_links":{"self":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/comments?post=1410"}],"version-history":[{"count":2,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1410\/revisions"}],"predecessor-version":[{"id":2790,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1410\/revisions\/2790"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media\/48"}],"wp:attachment":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media?parent=1410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/categories?post=1410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/tags?post=1410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}