Haberler:

Foruma Resim Yükleme ve Boyut Sınırlaması ( ! )  https://bit.ly/2GMFb8H

Ana Menü

ESP8266 Lua Programlama

Başlatan MrDarK, 17 Nisan 2015, 10:35:44

MrDarK

Arkadaşlar merhaba;

Biliyorsunuz IoT (Internet of Think) çılgınlığının artması ve yaygınlaşması üzerine Wifi modüller oldukça ucuz fiyatlara ellerimize düşmüş durumda :) Hangi modülden bahsettiğimi eminim anladınız fakat yinede söyleyeyim ESP8266. Çeşitli kılıflarda farklı boylarda bulabileceğimiz bu ürün AT komutları ile haberleşmekte. Bir MCU yardımıyla bu modül ile haberleşip istediğimiz işi yaptırabiliyoruz.
Fakat modülün içine yazılım yazmanında kolay olacağını düşünüyorum.

Diyeceğim o ki bu başlık altında Lua Programlama'ya ait bilgiler , örnekler ve projeler yer alacak. Basit led yakmaktan tutun pwm'e kadar birçok örnek yapıp elektronikte türkçe kaynaklara bir yenisini daha eklemek istiyorum. Tabiki Picproje farkıyla ! Yardımcı olmak , görev paylaşımı yapmak isteyen veya enteresan fikirleri olan arkadaşları hem konuya hemde özel mesajla iletişime bekliyorum :)

Ders 1 - Tabiki Led Yak ve Söndür (Olacak)
Picproje Eğitim Gönüllüleri ~ MrDarK

cripple

hocam stm için hazırladığınız örnek çok güzel olmuş ellerinize sağlık
ben lua ile programlamayı denedim bende esp-01 modeli var GPIO0 ve GPIO2 pinleri için çıkış var sadece
internetten bulduğum örnek kodlarla çalıştırdım (led yak söndür çıkışları pwm e de çevirdim denemeler yaptım)

şöyle bir sorunla karşılaştım GPIO0 pin gnd bağlanıp reset atınca programlaya geçiyor
IO olarak kullanırkende örnek led bağlayınca grounda bağlanması gerektiğinden programlama moduna geçiyor ve çalışmıyor
bu sorunu transistör bağlayarak aştım fakat bu seferde boot tan hemen sonra 2 saniyeliğine kendilğinden çıkış veriyor daha
sonra normal çalışmaya devam ediyor anladığım kadarıyla başlangıçta GPIO0 pininen denetleme yapıyor programlama modundamı
çalışcam normal modda mı. pull up olarak ayarladım GPIO0 ı fakat sonuç aynı

araştırmalar sonucu daha fazla pin çıkışı olan bir esp ye ihtiyaç duyulduğu kanısına vardım ve okuduğum bazı yabancı kaynaklarda
özellikle belirtmişler programlamaya etki eden pinler(GPIO0,GPIO2,GPIO15) çok mecbur kalınmadıkça kullanılmaması tavsiye ediliyor.
esp-12 siparişi verdim geldiğinde lua programlama çalışmalarına devam etmeyi planlıyorum

şimdilik kullandığım led on off programını paylaşayım
wifi.setmode(wifi.STATION)
wifi.sta.config("wifi adı","wifi şifresi")
print(wifi.sta.getip())
led1 = 3
led2 = 4
gpio.mode(led1, gpio.OUTPUT,gpio.PULLUP)
gpio.mode(led2, gpio.OUTPUT,gpio.PULLDOWN)
gpio.write(led1, gpio.LOW)
gpio.write(led2, gpio.LOW)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
    conn:on("receive", function(client,request)
        local buf = "";
        local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
        if(method == nil)then
            _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
        end
        local _GET = {}
        if (vars ~= nil)then
            for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
                _GET[k] = v
            end
        end
        buf = buf.."<h1> ESP8266 Web Server</h1>";
        buf = buf.."<p>GPIO0 <a href=\"?pin=ON1\"><button>ON</button></a>&nbsp;<a href=\"?pin=OFF1\"><button>OFF</button></a></p>";
        buf = buf.."<p>GPIO2 <a href=\"?pin=ON2\"><button>ON</button></a>&nbsp;<a href=\"?pin=OFF2\"><button>OFF</button></a></p>";
        local _on,_off = "",""
        if(_GET.pin == "ON1")then
              gpio.write(led1, gpio.HIGH);
        elseif(_GET.pin == "OFF1")then
              gpio.write(led1, gpio.LOW);
        elseif(_GET.pin == "ON2")then
              gpio.write(led2, gpio.HIGH);
        elseif(_GET.pin == "OFF2")then
              gpio.write(led2, gpio.LOW);
        end
        client:send(buf);
        client:close();
        collectgarbage();
    end)
end)


bu kodlar alıntıdır konunun canlanması amacıyla paylaştım.
çalışma yapılırsa katkıda bulunmak isterim.
saygılar..

kaganayanoglu

#2
Bu konuda bende çalışmak istiyorum. Fakat Türkçe kaynak bulmak oldukça zor. ESP ve LUA konusunda kaynak oluşturmak amacıyla bu konular hakkında bilgisi olanların katılımda bulunması ülkemizde bu konunun yaygınlaşmasını sağlayacak kanaatindeyim. ESP8266 modülü sadece işlemci olarak kullanmak bile (wifi kısmını kullanmadan)ekonomik olarak ve programa kolaylığı yönünden daha kolay olacağa benziyor.

Katkıda bulunacak herkese şimdiden teşekkürler.


mesaj birleştirme:: 26 Temmuz 2016, 09:11:58

Öncelikle ESPlorer de programlama ve programın çalışmasını takip etmek çok kolay oluyor. Fakat bazı komutların kullanımı konusunda yine Türkçe kaynak eksikliği (!) var.

Örneğin;
tmr.alarm komutu konusunda şöyle bir kaynak var.


Timer Module
Since   Origin / Contributor   Maintainer   Source
2014-12-12   Zeroday   dnc40085   tmr.c
The tmr module allows access to simple timers, the system counter and uptime.

It is aimed at setting up regularly occurring tasks, timing out operations, and provide low-resolution deltas.

What the tmr module is not however, is a time keeping module. While most timeouts are expressed in milliseconds or even microseconds, the accuracy is limited and compounding errors would lead to rather inaccurate time keeping. Consider using the rtctime module for "wall clock" time.

NodeMCU provides 7 timers, numbered 0-6. It is currently up to the user to keep track of which timers are used for what.

tmr.alarm()   This is a convenience function combining tmr.
tmr.delay()   Busyloops the processor for a specified number of microseconds.
tmr.interval()   Changes a registered timer's expiry interval.
tmr.now()   Returns the system counter, which counts in microseconds.
tmr.register()   Configures a timer and registers the callback function to call on expiry.
tmr.softwd()   Provides a simple software watchdog, which needs to be re-armed or disabled before it expires, or the system will be restarted.
tmr.start()   Starts or restarts a previously configured timer.
tmr.state()   Checks the state of a timer.
tmr.stop()   Stops a running timer, but does not unregister it.
tmr.time()   Returns the system uptime, in seconds.
tmr.unregister()   Stops the timer (if running) and unregisters the associated callback.
tmr.wdclr()   Feed the system watchdog.
tmr.alarm()
This is a convenience function combining tmr.register() and tmr.start() into a single call.

To free up the resources with this timer when done using it, call tmr.unregister() on it. For one-shot timers this is not necessary, unless they were stopped before they expired.

Parameters
id timer id (0-6)
interval_ms timer interval in milliseconds. Maximum value is 6870947 (1:54:30.947).
mode timer mode:
tmr.ALARM_SINGLE a one-shot alarm (and no need to call tmr.unregister())
tmr.ALARM_SEMI manually repeating alarm (call tmr.start() to restart)
tmr.ALARM_AUTO automatically repeating alarm
Returns
true if the timer was started, false on error

Example
if not tmr.alarm(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end) then print("whoopsie") end
See also
tmr.register()
tmr.start()
tmr.unregister()
tmr.delay()
Busyloops the processor for a specified number of microseconds.

This is in general a bad idea, because nothing else gets to run, and the networking stack (and other things) can fall over as a result. The only time tmr.delay() may be appropriate to use is if dealing with a peripheral device which needs a (very) brief delay between commands, or similar. Use with caution!

Also note that the actual amount of time delayed for may be noticeably greater, both as a result of timing inaccuracies as well as interrupts which may run during this time.

Syntax
tmr.delay(us)

Parameters
us microseconds to busyloop for

Returns
nil

Example
tmr.delay(100)
tmr.interval()
Changes a registered timer's expiry interval.

Syntax
tmr.interval(id, interval_ms)

Parameters
id timer id (0-6)
interval_ms new timer interval in milliseconds. Maximum value is 6870947 (1:54:30.947).
Returns
nil

Example
tmr.register(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end)
tmr.interval(0, 3000) -- actually, 3 seconds is better!
tmr.now()
Returns the system counter, which counts in microseconds. Limited to 31 bits, after that it wraps around back to zero. That is essential if you use this function to debounce or throttle GPIO input.

Syntax
tmr.now()

Parameters
none

Returns
the current value of the system counter

Example
print(tmr.now())
print(tmr.now())
tmr.register()
Configures a timer and registers the callback function to call on expiry.

To free up the resources with this timer when done using it, call tmr.unregister() on it. For one-shot timers this is not necessary, unless they were stopped before they expired.

Syntax
tmr.register(id, interval_ms, mode, func)

Parameters
id timer id (0-6)
interval_ms timer interval in milliseconds. Maximum value is 6870947 (1:54:30.947).
mode timer mode:
tmr.ALARM_SINGLE a one-shot alarm (and no need to call tmr.unregister())
tmr.ALARM_SEMI manually repeating alarm (call tmr.start() to restart)
tmr.ALARM_AUTO automatically repeating alarm
Note that registering does not start the alarm.

Returns
nil

Example
tmr.register(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end)
tmr.start(0)
See also
tmr.alarm()

tmr.softwd()
Provides a simple software watchdog, which needs to be re-armed or disabled before it expires, or the system will be restarted.

Syntax
tmr.softwd(timeout_s)

Parameters
timeout_s watchdog timeout, in seconds. To disable the watchdog, use -1 (or any other negative value).

Returns
nil

Example
function on_success_callback()
  tmr.softwd(-1)
  print("Complex task done, soft watchdog disabled!")
end

tmr.softwd(5)
-- go off and attempt to do whatever might need a restart to recover from
complex_stuff_which_might_never_call_the_callback(on_success_callback)
tmr.start()
Starts or restarts a previously configured timer.

Syntax
tmr.start(id)

Parameters
id timer id (0-6)

Returns
true if the timer was started, false on error

Example
tmr.register(0, 5000, tmr.ALARM_SINGLE, function() print("hey there") end)
if not tmr.start(0) then print("uh oh") end
See also
tmr.register()
tmr.stop()
tmr.unregister()
tmr.state()
Checks the state of a timer.

Syntax
tmr.state(id)

Parameters
id timer id (0-6)

Returns
(bool, int) or nil

If the specified timer is registered, returns whether it is currently started and its mode. If the timer is not registered, nil is returned.

Example
running, mode = tmr.state(0)
tmr.stop()
Stops a running timer, but does not unregister it. A stopped timer can be restarted with tmr.start().

Syntax
tmr.stop(id)

Parameters
id timer id (0-6)

Returns
true if the timer was stopped, false on error

Example
if not tmr.stop(2) then print("timer 2 not stopped, not registered?") end
See also
tmr.register()
tmr.stop()
tmr.unregister()
tmr.time()
Returns the system uptime, in seconds. Limited to 31 bits, after that it wraps around back to zero.

Syntax
tmr.time()

Parameters
none

Returns
the system uptime, in seconds, possibly wrapped around

Example
print("Uptime (probably):", tmr.time())
tmr.unregister()
Stops the timer (if running) and unregisters the associated callback.

This isn't necessary for one-shot timers (tmr.ALARM_SINGLE), as those automatically unregister themselves when fired.

Syntax
tmr.unregister(id)

Parameters
id timer id (0-6)

Returns
nil

Example
tmr.unregister(0)
See also
tmr.register()

tmr.wdclr()
Feed the system watchdog.

In general, if you ever need to use this function, you are doing it wrong.

The event-driven model of NodeMCU means that there is no need to be sitting in hard loops waiting for things to occur. Rather, simply use the callbacks to get notified when somethings happens. With this approach, there should never be a need to manually feed the system watchdog.

Syntax
tmr.wdclr()

Parameters
none

Returns
nil


Fakat
"tmr.alarm (0, 1000, 1,function())"
komutunun kullanımındaki (0,1000,1,function()) parametrelerin neyi anlattığını bulamadım.

Yardımcı olacak arkadaşlara şimdiden teşekkürler.


MT

http://benlo.com/esp8266/esp8266QuickStart.html hızlı bir başlangıç için faydalı bir link. Türkçeye çevirilebir.

kaganayanoglu

#4
print("Basla") --ESPlorer de init.lua dosyasının çalıştığını görürken işe yarıyor. Yazmasanızda olur.
birinciled=3  -- birinci led GPIO3 e bağlı demek.
ikinciled=1 -- ikinci led GPIO1 e bağlı demek.

gpio.mode(birinciled,gpio.OUTPUT) -- birinciled'in baklı olduğu GPIO çıkış olsun.
gpio.mode(ikinciled,gpio.OUTPUT)-- ikinciled'in baklı olduğu GPIO da çıkış olsun.

sayi=0 -- Daha sonra kullanacağım "sayı" değişkenini sıfırla.

function atesleme()  -- Burada bir fonksiyon tanımlanıyor. Adı ise ateşleme
gpio.write(birinciled, gpio.HIGH);  -- birinciledin bağlı olduğu GPIO yu "Hıgh" yap. Yani +5v çıkış ver.
tmr.delay(1000000); -- 1,000,000 mikrosn yani 1 sn bekle
gpio.write(birinciled, gpio.LOW);-- birinciledin bağlı olduğu GPIO yu "Low" yap. Yani 0 v çıkış ver.
tmr.delay(100000);-- 1,000,000 mikrosn yani 1 sn bekle
gpio.write(ikinciled, gpio.HIGH);-- ikinciledin bağlı olduğu GPIO yu "Hıgh" yap. Yani +5v çıkış ver.
tmr.delay(200000);
gpio.write(ikinciled, gpio.LOW);-- ikinciledin bağlı olduğu GPIO yu "Low" yap. Yani 0 v çıkış ver.
end -- Bu fonksiyon bitti.

sn=0; --Daha sonra kullanacağım "sn" değişkenini sıfırla.
dk=0; --Daha sonra kullanacağım "dk" değişkenini sıfırla.

-- Aşağıda timer kurularak yukarıdaki fonksiyon yürütülüyor.
tmr.alarm (1, 1000, 1,function() 

sn=sn+1; -- sn üstüne 1 ekle. Yani sn yede bir (Yukarıdaki 1000) hep bir artarak git. 
if sn==60 then -- sn 60 olunca 
sn=0; -- saniye değişkenini sıfırla
end -- sn için zaman saydırma işi bitti. 
    if (sn==3) then -- sn=3 degerini aldığında
        atesleme(); -- ateşleme fonksiyonunu çalıştır.
        print("3.Saniye"); -- Ekrana 3.saniye yaz.
    elseif (sn==9) then -- sn=6 değerini aldığında yani sayaç 9 olur.
        atesleme();-- ateşleme fonksiyonunu çalıştır.
        print("6.Saniye");-- Ekrana 6.saniye yaz.
        print("Bitti")-- Ekrana "Bitti" yaz.
    end
    end) -- tmr.alarm (0, 1000, 1,function()) daki son parantezi kapat.


Öğrendiğim bazı komutların ne işe yaradığını örnekle anlatmaya çalıştım.
Fakat işlemler bir kez bittikten sonra yaklaşık 1 dk bekleyip tekrar başa dönüyor. Sebebini anlayamadım.  :o

cripple

#5
son yazdığım lua kodlarıyla esp çok kararsız çalışıyordu program 1-2 kere çalışıp sonra donuyordu veya 1-2 dk çalışıp patlıyordu.bootloader stabil değil.(aynı işlmeleri arduino ide ile yaptırınca hiçbir sıkıntı yaşamadım)

bbs2006

Bunun avantaji ve dezavantiji nedir. Bunun digerlerinden farki NE. Ornek picten farki ne

okg

8266-12e kullanmaya çalışıyorum ancak hala güncelleme kısmındayım,bir türlü çözemedim....
KTU Elektronik Haberleşme - YTÜ Haberşelme YL - GTU Haberleşme YL

gokhangokcen

#8
bir örnekte benden olsun. Bende baya tırmalamıştım zamanında kurar iken. Ama gerçekten çok basit bir şekilde ilerliyor. Lua kodlarıda oldukça basit şekilde kullanılıyor. Ben bir access point oluşturup web server gibi çalıştırdım. Sayfadan gpio pinlerini kontrol ediyordum. Açıp kapatıp pwm şeklinde. Bir site vardı bulursam ekleyeyim. oldukça fazla örnekler vardı. DS18B20/DS18S20 sensör , ı2c  vb. örnekleri vardı.

SSID = "wifi adı"
PW = "wifi şifresi"
IPADR = "192.168.1.110" --//Requested static IP address for the ESP
IPROUTER = "192.168.1.1" --// IP address for the Wifi router
wifi.setmode(wifi.STATION)
wifi.sta.setip({ip=IPADR,netmask="255.255.255.0",gateway=IPROUTER})
wifi.sta.config(SSID,PW)

deger = 0;
pwm.setup(3, 1000, deger)
pwm.start(3)  
led2 = 4
gpio.mode(led2, gpio.OUTPUT)
gpio.write(led2,gpio.LOW)

srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
    conn:on("receive", function(client,request)
        local buf = "";
        local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
        if(method == nil)then
            _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
        end
        local _GET = {}
        if (vars ~= nil)then
            for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
                _GET[k] = v
            end
        end
        if(_GET.pin == "ON1")then
              deger = 1024
              pwm.setduty(3, deger-1)
        elseif(_GET.pin == "OFF1")then
              deger = 0
              pwm.setduty(3, deger)
        elseif(_GET.pin == "100")then
              deger = 1024
              pwm.setduty(3, deger-1)
        elseif(_GET.pin == "75")then
              deger = 768
              pwm.setduty(3, deger)
        elseif(_GET.pin == "50")then
              deger = 512
              pwm.setduty(3, deger)
        elseif(_GET.pin == "25")then
              deger = 256
              pwm.setduty(3, deger)
        elseif(_GET.pin == "33")then
              deger = deger - 51.2;
              if deger<55 then
              deger = 51.2;
              end
              pwm.setduty(3, deger)
    
        elseif(_GET.pin == "44")then
              deger = deger + 51.2;
              if deger>1023 then
              deger = 1024;
              end
              pwm.setduty(3, deger-1)
        end
        buf = buf..('HTTP/1.1 200 OK\n\n');
        buf = buf..('<!DOCTYPE HTML>');
        buf = buf.."<html>";
        buf = buf.."<title>Ar-Ge</title>";
        buf = buf.."<body>";
        buf = buf.."<h1><center>AR-GE</center></h1>";
        buf = buf.."<hr>"
        buf = buf.."<center>Son durum : %" .. (deger * 100 / 1024) .. "</center>";
        buf = buf.."<hr>";
        buf = buf.."<p><center>Led <a href=\"?pin=ON1\"><button>ON</button></a>&nbsp;<a href=\"?pin=OFF1\"><button>OFF</button></a></center></p>";
        buf = buf.."<p><center>Led Dim <a href=\"?pin=100\"><button>%100</button></a>&nbsp;<a href=\"?pin=75\"><button>%75</button></a>&nbsp;<a href=\"?pin=50\"><button>%50</button></a>&nbsp;<a href=\"?pin=25\"><button>%25</button></a></center></p>";
        buf = buf.."<p><center>Deger <a href=\"?pin=33\"><button>-5</button></a>&nbsp;<a href=\"?pin=44\"><button>+5</button></a></center></p>";
        buf = buf.."</body>";
        buf = buf.."</html>";
        local _on,_off = "",""
        
        client:send(buf);
        client:close();
        collectgarbage();
    end)
end)


bu örnek access point olan,

--wifi.setmode(wifi.STATION)
--wifi.sta.config("wifi adı","şifresi")
--print(wifi.sta.getip())
--SSID = "wifi adı"
--PW = "şifresi"
--IPADR = "192.168.1.110" --//Requested static IP address for the ESP
--IPROUTER = "192.168.1.1" --// IP address for the Wifi router
--wifi.setmode(wifi.STATION)
--wifi.sta.setip({ip=IPADR,netmask="255.255.255.0",gateway=IPROUTER})
--wifi.sta.config(SSID,PW)
     print("Ready to start soft ap")
     
     local str=wifi.ap.getmac();
     local ssidTemp=string.format("%s%s%s",string.sub(str,10,11),string.sub(str,13,14),string.sub(str,16,17));
     
     cfg={}
     cfg.ssid="AR-GE"--..ssidTemp;
     cfg.pwd="12345678"
     wifi.ap.config(cfg)
     
     cfg={}
     cfg.ip="192.168.1.1";
     cfg.netmask="255.255.255.0";
     cfg.gateway="192.168.1.1";
     wifi.ap.setip(cfg);
     wifi.setmode(wifi.SOFTAP)
     
     str=nil;
     ssidTemp=nil;
     collectgarbage();
     
     print("Soft AP started")
     print("Heep:(bytes)"..node.heap());
     print("MAC:"..wifi.ap.getmac().."\r\nIP:"..wifi.ap.getip());


led1 = 3
led2 = 4
gpio.mode(led1, gpio.OUTPUT)
gpio.mode(led2, gpio.OUTPUT)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
    conn:on("receive", function(client,request)
        local buf = "";
        local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
        if(method == nil)then
            _, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
        end
        local _GET = {}
        if (vars ~= nil)then
            for k, v in string.gmatch(vars, "(%w+)=(%w+)&*") do
                _GET[k] = v
            end
        end
        buf = buf.."<h1><center>Denay Bilisim AR-GE</center></h1>";
        buf = buf.."<p><center>GPIO0 <a href=\"?pin=ON1\"><button>ON</button></a>&nbsp;<a href=\"?pin=OFF1\"><button>OFF</button></a></center></p>";
        buf = buf.."<p><center>GPIO2 <a href=\"?pin=ON2\"><button>ON</button></a>&nbsp;<a href=\"?pin=OFF2\"><button>OFF</button></a></center></p>";
        local _on,_off = "",""
        if(_GET.pin == "ON1")then
              gpio.write(led1, gpio.HIGH);
        elseif(_GET.pin == "OFF1")then
              gpio.write(led1, gpio.LOW);
        elseif(_GET.pin == "ON2")then
              gpio.write(led2, gpio.HIGH);
        elseif(_GET.pin == "OFF2")then
              gpio.write(led2, gpio.LOW);
        end
        client:send(buf);
        client:close();
        collectgarbage();
    end)
end)




buda çeşitli örneklerin olduğu site;
http://nodemcu.com/index_en.html

esp için flash yükleme programı ve anlatımları mevcut. ben nodemcu_float_0.9.6-dev_20150704 versiyonunu kullanıyordum. Noktalı işlemleri oldukça rahat yapıyordu. sorunla karşılaşmadım. Belki daha güncel versiyonlar çıkmıştır.
http://www.whatimade.today/loading-the-nodemcu-firmware-on-the-esp8266-windows-guide/
http://www.firatdeveci.com/esp8266-wi-fi-module-giris/
esplorer için (derleyici diyebiliriz)
http://esp8266.ru/esplorer/
Bildiğini paylaşmak, Allah'ın verdiği öğrenme yeteneğinin zekatıdır.

LukeSkywalker

@MrDarK
Konuya bir el atsanız. Derleyicisi nedir? Nasıl başlanır gibi bir yönlendirme çok iyi olacaktır.
Ben de son zamanlarda LUA'ya merak sardım. Daha önce ekstra bir işlemciyle esp8266 üzerinden türlü işlemler yapıyordum fakat işlemciye ihtiyaç duymadan programlamak güzel olmalı.


MrDarK

Mesaj alındı @LukeSkywalker hocam;

Bu akşam ilk giriş kısmını yapalım. Bakalım neler olacak :) Şimdiye kadar esp'ye arduino sürümü ile kod atmıştım. Lua'da kod yazmakta çok zor olmasa gerek.
Picproje Eğitim Gönüllüleri ~ MrDarK

polleme

Lua'yı değerlendirirken MicroPython'u gözardı etmeyin derim. O da sağlam geliyor. Komut satırı ve web arayüzünden işlem yapma, doğrudan Python komutu işletebilme gibi yetenekleri var. Lua'ya tam bakarken son anda vazgeçip Micropython'a merak saldım. Bunu öğrenince Raspberry Pi'da da Python kullanılabildiğinden bir taşla iki kuş imkanı olabilir.

dhan000

arduino ide mi daha iyi olur yoksa lua mı diye sormak istiyorum veya basitce kodları birbirine aktarmak nasıl olur yapılablir mi...
nette her ikisi içinde örnekler var...

AXI

Lua arduinoya göre çok çok daha stabil. Ama ramı arduino kadar titz kullanmıyor.Eğer çok fazla değişken kullanılmayacaksa kesinlikle LUA.

MicroPythona 2-3 ay önce baya bir kafa yordum.Ve LUA ile karşılaştırılırsa en büyük ilk farkı ramı 5-6 kat daha verimli kullanıyor.Kodlar daha hızlı işleniyor.Hatta daha stabil.Ama bence projelerde kullanmak için daha çok yeni.Bir çok sensör ve kütüphanede sıkıntı yaşadığım için şuan hala LUA ile çalışıyorum.
2. farkıda micro phyton eş zamanlı çalışıyor.Yani sanki raspberrye kurulmuş bir işletim sistemi gibi.CLI ile haberleşilebiliyor ve phytondaki olduğu gibi print diyorsunuz direk çıktı veriyor.
Ama eğer geliştirilmeye devam ederse micropython büyük bir fark yaratacak gibi görünüyor.
Ki bence microphyton gelişmeye devam ederse bir çok micro işlemci desteği çıkar.
"Hedeflerin bittiği tek yer, YENİ hedeflerin başlangıcıdır"

mustafa_cmbz

merhabalar..

Lua ile elimdeki esp8266 -14 e bağlantı yaptım sağ üstteki port seçeneinden GPIO.0 ı 1 yada 0 yapabiliyorum ama modül üzerindeki diğer çıkışları kontrol edemiyorum.Sanırım bu tarz programlar esp12 ye göre yazılmış port isimleri falan farklı geldi birinde gpıo olarak tanımlıyken diğerinde pc4 vs gibi yazılmış.


esp14 kullanımı zor bir modülmüş nerden aldıysam artık lanet ettim vallahi..[size=78%] [/size]