{"id":763,"date":"2023-10-10T08:00:00","date_gmt":"2023-10-10T06:00:00","guid":{"rendered":"https:\/\/www.fuhselab.de\/?p=763"},"modified":"2023-09-11T09:48:21","modified_gmt":"2023-09-11T07:48:21","slug":"arduino-funktionen","status":"publish","type":"post","link":"https:\/\/www.fuhselab.de\/index.php\/2023\/10\/10\/arduino-funktionen\/","title":{"rendered":"Arduino Funktionen"},"content":{"rendered":"\n<p>Mit eigenen Funktionen k\u00f6nnen Arduino Sketche mit weniger Aufwand erstellt werden und werden auch leichter lesbar. Dieser Artikel zeigt wie es geht&#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Vorbereitungen:<\/strong><\/p>\n\n\n\n<p>Dieses Projekt schaltet nur die LED ein und aus die der Arduino auf seinem Board schon mitliefert und deshalb braucht es nur folgende Bauteile:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.reichelt.de\/experimentier-slide-steckboard-640-200-kontakte-steckboard-s8-p177330.html?CCOUNTRY=445&amp;LANGUAGE=de&amp;trstct=pos_12&amp;nbc=1&amp;&amp;r=1\">Steckboard<\/a><\/li>\n<\/ul>\n\n\n\n<p>Wer mag kann nat\u00fcrlich trotzdem auch eigene LEDs nutzen\u2026<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.reichelt.de\/entwicklerboards-kabel-set-verschiedene-laengen-65er-pack--debo-kabelset18-p282690.html?PROVID=2788&amp;gclid=EAIaIQobChMI5Mqvt8jp-wIVUASLCh1ozQTZEAQYAiABEgK1X_D_BwE\">Kabelset f\u00fcr Entwicklerboards<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.reichelt.de\/led-8-mm-bedrahtet-rot-400-mcd-60--kbt-l-793srd-d-p231029.html?&amp;trstct=pol_1&amp;nbc=1\">LED<\/a><\/li>\n<\/ul>\n\n\n\n<p><strong>Programmierung 1:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define LED 13\n#define del 200\n\nvoid setup()\n{\npinMode(LED,OUTPUT);\n}\n\nvoid blinkLED()\n{\ndigitalWrite(LED, HIGH);\ndelay(del);\ndigitalWrite(LED, LOW);\ndelay(del);\ndigitalWrite(LED, HIGH);\ndelay(del);\ndigitalWrite(LED, LOW);\ndelay(del);\n}\n\nvoid loop()\n{\nblinkLED();\ndelay(1000);\n}<\/code><\/pre>\n\n\n\n<p><strong>Programmierung 2:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define LED 13\n\nvoid setup()\n{\npinMode(LED,OUTPUT);\n}\n\nvoid blinkLED(int cycles, int del)\n{\nfor ( int z = 0 ; z &lt; cycles ; z++ )\n{\ndigitalWrite(LED, HIGH);\ndelay(del);\ndigitalWrite(LED, LOW);\ndelay(del);\n}\n}\n\nvoid loop()\n{\nblinkLED(12, 100);\ndelay(5000);\n}<\/code><\/pre>\n\n\n\n<p>Programmierung 2 ist nur eine logische Erweiterung zu Programmierung 1. Die Anzahl der Blinkvorg\u00e4nge und die Verz\u00f6gerungszeit k\u00f6nnen so besser eingestellt werden.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mit eigenen Funktionen k\u00f6nnen Arduino Sketche mit weniger Aufwand erstellt werden und werden auch leichter lesbar. Dieser Artikel zeigt wie es geht&#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-763","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\/763","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=763"}],"version-history":[{"count":1,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":764,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/763\/revisions\/764"}],"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=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/categories?post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/tags?post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}