{"id":2941,"date":"2026-01-13T08:00:00","date_gmt":"2026-01-13T07:00:00","guid":{"rendered":"https:\/\/www.fuhselab.de\/?p=2941"},"modified":"2026-01-06T08:16:21","modified_gmt":"2026-01-06T07:16:21","slug":"arduino-for-schleife-pwm-und-digital-in","status":"publish","type":"post","link":"https:\/\/www.fuhselab.de\/index.php\/2026\/01\/13\/arduino-for-schleife-pwm-und-digital-in\/","title":{"rendered":"Arduino for-Schleife, PWM und Digital In"},"content":{"rendered":"\n<p><br>Arduino Projekte 2, 3 und 4 bekommen jetzt einen gemeinsamen Artikel mit den Codes f\u00fcr eine for-Schleife, PWM und Digital In und das alles sogar kostenfrei&#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><br><strong>Wiederholungen mit for-Schleife:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int d = 100;\n\nvoid setup()\n{\npinMode(2, OUTPUT);\npinMode(3, OUTPUT);\npinMode(4, OUTPUT);\npinMode(5, OUTPUT);\npinMode(6, OUTPUT);\n}\n\nvoid loop()\n{\nfor (int a =2; a &lt; 7; a++)\n{\ndigitalWrite(a, HIGH);\ndelay(d);\ndigitalWrite(a, LOW);\ndelay(d);\n}\n}<\/code><\/pre>\n\n\n\n<p><br><strong>PWM Experimente:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int led01 = 13;\nint del = 5;\n\nvoid setup()\n{\npinMode(led01, OUTPUT);\n}\n\nvoid loop()\n{\nfor (int a = 0; a&lt; 256 ; a++)\n{\nanalogWrite(led01, a);\ndelay(del);\n}\n\nfor(int a = 255; a>=0; a--)\n{\nanalogWrite(led01, a);\ndelay(del);\n}\ndelay(200);\n}<\/code><\/pre>\n\n\n\n<p><br><strong>Beispiel f\u00fcr digitale Eing\u00e4nge:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define LED 12\n#define BUTTON 7\n\nvoid setup()\n{\npinMode(LED, OUTPUT);\npinMode(BUTTON, INPUT);\n}\n\nvoid loop()\n{\nif (digitalRead(BUTTON) == HIGH)\n{\ndigitalWrite(LED, HIGH);\ndelay(500);\ndigitalWrite(LED, LOW);\n}\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arduino Projekte 2, 3 und 4 bekommen jetzt einen gemeinsamen Artikel mit den Codes f\u00fcr eine for-Schleife, PWM und Digital In und das alles sogar kostenfrei&#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-2941","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\/2941","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=2941"}],"version-history":[{"count":1,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/2941\/revisions"}],"predecessor-version":[{"id":2942,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/2941\/revisions\/2942"}],"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=2941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/categories?post=2941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/tags?post=2941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}