{"id":275,"date":"2018-06-26T11:41:13","date_gmt":"2018-06-26T11:41:13","guid":{"rendered":"http:\/\/mikrobotik.com\/wp2\/?p=275"},"modified":"2023-04-02T17:04:06","modified_gmt":"2023-04-02T14:04:06","slug":"esp8266-01-ile-nodemcu-olarak-led-kontrol-edilmesi","status":"publish","type":"post","link":"https:\/\/www.mikrobotik.com\/wp2\/2018\/06\/26\/esp8266-01-ile-nodemcu-olarak-led-kontrol-edilmesi\/","title":{"rendered":"ESP8266-01 ile NODEMCU olarak  LED kontrol edilmesi"},"content":{"rendered":"<p>Daha \u00f6nceki yaz\u0131mda \u00a0ESP01 mod\u00fcl\u00fcn\u00fc, nas\u0131l NODEMCU olarak kullanabilece\u011fimizi anlatm\u0131\u015ft\u0131m. \u00a0<strong><a href=\"https:\/\/www.mikrobotik.com\/wp2\/2018\/06\/01\/esp_01\/\" target=\"_blank\" rel=\"noopener\">\u00d6nceki NODEMCU yaz\u0131s\u0131.\u00a0<\/a><\/strong><br \/>\n<img decoding=\"async\" class=\"size-full wp-image-319 aligncenter lazyload\"Noto Sans', sans-serif; text-align: inherit; line-height: 1.6471; background-color: transparent;\" data-src=\"https:\/\/www.mikrobotik.com\/wp2\/wp-content\/uploads\/2018\/06\/espledcontrol.jpg\" alt=\"Devre \u00f6rnektir.\" width=\"710\" height=\"366\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 710px; --smush-placeholder-aspect-ratio: 710\/366;\" \/><\/p>\n<p><span style=\"color: #ff6600;\"><strong>Devre mant\u0131k olarak \u00f6rnektir. Ger\u00e7ek \u00a0devrede gerekli yerlerde\u00a0diren\u00e7ler olmas\u0131 gerekir. Ayr\u0131ca a\u015fa\u011f\u0131daki videoda GPIO14 bulunmuyor. sadece istendi\u011finde entegre bacaklar\u0131ndan GPIO pinlerini \u00e7\u0131karabilirsiniz diye \u00f6rnek olarak verildi. Bununla birlikte TX ve RX bacaklar\u0131n\u0131 ba\u015fka yerde seri haberle\u015fme olarak kullanmayacaksan\u0131z onlar\u0131 da GPIO olarak kullanabilirsiniz. Bu tip \u00f6rnekler internette mevcut ben denemedim.\u00a0<\/strong><\/span>Bu yaz\u0131mda ise Nodemcu olarak kullan\u0131lmas\u0131,\u00a0<strong>LUA LOADER<\/strong> program\u0131n\u0131n \u00e7al\u0131\u015fmas\u0131n\u0131 ve\u00a0ESP-01 Mod\u00fcl\u00fcn\u00fcn GPIO pinlerini kullanarak LED yada R\u00d6LE kontrol\u00fc gibi i\u015flerin nas\u0131l yap\u0131ld\u0131\u011f\u0131n\u0131 okuyacaks\u0131n\u0131z.<br \/>\n\u00d6ncelikle Nodemcu <strong><a href=\"https:\/\/github.com\/nodemcu\" target=\"_blank\" rel=\"noopener\">GITHUB<\/a><\/strong> sitesinden indrece\u011finiz NODEMCU flasher program\u0131yla mod\u00fcl\u00fcn\u00fcz\u00fc \u00f6nceki yaz\u0131mdaki gibi programlay\u0131n. Bunu yaparken mod\u00fcl\u00fcn\u00fcz\u00fcn rengine g\u00f6re haf\u0131za miktar\u0131n\u0131 belirlemeyi unutmay\u0131n. ( <a href=\"https:\/\/www.mikrobotik.com\/wp2\/2018\/06\/22\/esp8266-01-puf-noktalari\/\" target=\"_blank\" rel=\"noopener\">Bu konuda p\u00fcf noktalar\u0131 yaz\u0131m size yol g\u00f6sterecektir.<\/a>) Ayr\u0131ca <span style=\"color: #ff6600;\"><strong>Flash programlamada GPIO0 pininin konumuna dikkat edin.<\/strong><\/span><\/p>\n<p><span style=\"color: #ff6600;\"><span style=\"color: #000000;\">Flash program y\u00fcklendikten sonra<\/span><\/span> <strong><span style=\"color: #ff6600;\">GPIO pinini flash programlama modundan \u00e7\u0131kar\u0131n.<\/span><\/strong>Sonras\u0131nda ise mod\u00fcl\u00fcn\u00fcz\u00fc \u00e7al\u0131\u015ft\u0131r\u0131p <strong>LUALOADER<\/strong> program\u0131n\u0131 sitesinden y\u00fcklediyseniz program\u0131 a\u00e7\u0131n.<\/p>\n<p>Ayr\u0131ca<strong> LUA<\/strong> \u00a0programlar\u0131n\u0131 g\u00f6rmek ve de\u011fi\u015fiklik yapmak i\u00e7in <a href=\"https:\/\/notepad-plus-plus.org\/downloads\/\" target=\"_blank\" rel=\"noopener\"><strong>NOTEPAD++<\/strong><\/a> program\u0131n\u0131 y\u00fcklemeniz size kolayl\u0131k sa\u011flayacakt\u0131r.<\/p>\n<p>Bunlar\u0131 yaparken ise ESP-01 mod\u00fcl\u00fcn\u00fcn GPIO-0 ve GPIO-2 u\u00e7lar\u0131ndan 220R diren\u00e7le LED seri ba\u011flay\u0131p GND ye ba\u011flay\u0131n. Bunlar sizin GPIO-0 ve GPIO-2 u\u00e7lar\u0131ndan kontrol edece\u011finiz ledler olacakt\u0131r. (<span style=\"color: #ff0000;\"><strong>diren\u00e7 ba\u011flamadan led koyarsan\u0131z esp-01 mod\u00fcl\u00fcn\u00fc bozabilirsiniz<\/strong><\/span>.)<\/p>\n<p>Ayg\u0131t y\u00f6neticisinden bakarak ESP-01 in ba\u011fl\u0131 bulundu\u011fu portu g\u00f6r\u00fcn ve lualoader&#8217;\u0131n\u00a0<strong>com port settings<\/strong> k\u0131sm\u0131ndan ayarlay\u0131p 9600 h\u0131z\u0131nda portu a\u00e7\u0131n.<\/p>\n<p>Bu haz\u0131rl\u0131klardan sonra videoyu izleyerek ad\u0131m ad\u0131m i\u015flemleri yaparak \u00f6\u011frenebilirsiniz. <strong><span style=\"color: #ff6600;\">Video i\u00e7erisinde bir yerde Nodemcuyu ne tip uygulamalarda nas\u0131l kullanabilece\u011finize dair ayr\u0131nt\u0131l\u0131 bilgilere yer verdim.<\/span> <span style=\"color: #ff6600;\">Bu bilgiler nodemcudan nas\u0131l faydalanabilirim sorunuzu cevaplayabilmek i\u00e7indir.<\/span><\/strong><\/p>\n<p><a href=\"https:\/\/github.com\/safaka123\/Mikrobotik_yazilarim\/blob\/main\/ESP8266_01_NODEMCU_LED_CONTROL\/luaprograms.rar\" target=\"_blank\" rel=\"noopener\">\u00d6rnek LUA Programlar\u0131n\u0131 indirebilirsiniz<\/a><\/p>\n<p>Bu programlar\u0131 indirip kendi mod\u00fcl\u00fcn\u00fcze y\u00fckleyerek denemeleri yapabilirsiniz.<br \/>\n<strong>Dikkat etmeniz gereken nokta<\/strong> LUA program\u0131nda bulunan SSID ismindeki a\u011fa ba\u011flanman\u0131z gerekir ki, Ledleri kontrol etmek i\u00e7in do\u011fru adresi verebilesiniz. Bu kimi zaman <strong>ESP8266<\/strong> a\u011f\u0131d\u0131r kimi zaman <strong>test<\/strong> a\u011f\u0131 olarak isimlendirilmi\u015f olabilir. Bunu ne zaman g\u00f6rebilirsiniz <strong><span style=\"color: #ff6600;\">ESP-01 mod\u00fcl\u00fc \u00e7al\u0131\u015ft\u0131r\u0131p program\u0131 &#8220;DOFILE&#8221; butonu ile \u00e7al\u0131\u015ft\u0131rd\u0131\u011f\u0131n\u0131zda a\u011f\u0131n\u0131zda g\u00f6rebilirsiniz. <span style=\"color: #ff0000;\">Videodaki IP adresi 192.168.4.1 dir.\u00a0<\/span><\/span><\/strong><\/p>\n<p><strong>Not:<\/strong> A\u015fa\u011f\u0131daki programda 2. sat\u0131rda <strong>pin=7<\/strong> yazan yere GPIO-0 i\u00e7in 3 ve GPIO-2 i\u00e7in ise 4 koyarsan\u0131z bunu kaydedip mod\u00fcl\u00fcn\u00fcze y\u00fcklerseniz ekranda &#8220;ON&#8221; &#8220;OFF&#8221; kelimelerini g\u00f6r\u00fcrken LED lerinizden birinin e\u015f zamanl\u0131 olarak yan\u0131p s\u00f6nd\u00fc\u011f\u00fcn\u00fc de g\u00f6rebilirsiniz. Videoda GPIO-3 ayarl\u0131 oldu\u011fundan led yan\u0131p s\u00f6nme g\u00f6r\u00fcnm\u00fcyordu.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"lua\" data-enlighter-title=\"B_LINK LUA \u00f6rnek program\" data-enlighter-group=\"1 ve 2.3.... gibi farkl\u0131 yaz\u0131n. ayn\u0131 sayfada hepsi 1 olursa tek tabloya al\u0131yor.\" data-enlighter-theme=\"beyond\"> \r\n----- BLINK -------------\r\npin=7 --gpio3\r\ngpio.mode(pin,gpio.OUTPUT)\r\ntmr.alarm(1, 500, 1, function()\r\n    -- print gpio read pin--\r\n    if gpio.read(pin) == 1 then\r\n        gpio.write( pin, gpio.LOW)\r\n        print (\"off\")\r\n    else\r\n        gpio.write( pin, gpio.HIGH)\r\n        print(\"ON\")\r\n    end\r\nend )\r\ncollectgarbage()<\/pre>\n<p><span style=\"color: #ff6600;\"><strong>T\u00fcm ESP mod\u00fcllerin portlar\u0131n\u0131n, NODEMCU LUA programlar\u0131nda kullan\u0131lan adreslemesi a\u015fa\u011f\u0131da belirtilmi\u015ftir.<\/strong><\/span> ESP8266-01 de 2 adet GPIO pin kullan\u0131ma a\u00e7\u0131lm\u0131\u015ft\u0131r. Bunlar\u0131n kodlar\u0131n\u0131 tablodan \u00f6\u011frenebilirsiniz. ( <span style=\"color: #ff9900;\"><strong>\u015eayet ince i\u015f\u00e7ilik yapabiliyorsan\u0131z entegre bacaklar\u0131na yapaca\u011f\u0131n\u0131z lehimlemeler ile ba\u015fka GPIO portlar\u0131na da ula\u015fabilirsiniz<\/strong><\/span>.)<\/p>\n<figure id=\"attachment_281\" aria-describedby=\"caption-attachment-281\" style=\"width: 417px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-281 lazyload\" data-src=\"https:\/\/www.mikrobotik.com\/wp2\/wp-content\/uploads\/2018\/06\/gpio_index.jpg\" alt=\"\" width=\"417\" height=\"289\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 417px; --smush-placeholder-aspect-ratio: 417\/289;\" \/><figcaption id=\"caption-attachment-281\" class=\"wp-caption-text\"><span style=\"color: #ff6600;\"><strong>ESP8266-01 NODEMCU GPIO INDEX TABLOSU<\/strong><\/span><\/figcaption><\/figure>\n<p><strong><span style=\"color: #ff0000;\">T\u00dcM PROGRAMLARA<\/span> <a href=\"https:\/\/github.com\/safaka123\/Mikrobotik_yazilarim\/tree\/main\/ESP8266_01_NODEMCU_LED_CONTROL\" target=\"_blank\" rel=\"noopener\">BURADAN ULA\u015eAB\u0130L\u0130RS\u0130N\u0130Z.<\/a><\/strong><\/p>\n<p><iframe style=\"border: 2px solid blue;\" data-src=\"https:\/\/www.youtube.com\/embed\/xrdTRmYOkWw\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" data-load-mode=\"1\"><span data-mce-type=\"bookmark\" style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" class=\"mce_SELRES_start lazyload\">\ufeff<\/span><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Daha \u00f6nceki yaz\u0131mda \u00a0ESP01 mod\u00fcl\u00fcn\u00fc, nas\u0131l NODEMCU olarak kullanabilece\u011fimizi anlatm\u0131\u015ft\u0131m. \u00a0\u00d6nceki NODEMCU yaz\u0131s\u0131.\u00a0 Devre mant\u0131k olarak \u00f6rnektir. Ger\u00e7ek \u00a0devrede gerekli yerlerde\u00a0diren\u00e7ler olmas\u0131 gerekir. Ayr\u0131ca a\u015fa\u011f\u0131daki videoda GPIO14 bulunmuyor. sadece istendi\u011finde&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,33,7],"tags":[],"class_list":["post-275","post","type-post","status-publish","format-standard","hentry","category-arduino","category-arduino_pic_digerleri","category-esp"],"_links":{"self":[{"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/posts\/275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":3,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/posts\/275\/revisions"}],"predecessor-version":[{"id":2530,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/posts\/275\/revisions\/2530"}],"wp:attachment":[{"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/media?parent=275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/categories?post=275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mikrobotik.com\/wp2\/wp-json\/wp\/v2\/tags?post=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}