Burak Çalışkan

ESP8266 buzzer

buzzerPin = 7
gpio.mode(buzzerPin, gpio.OUTPUT)

tones = {}

tones[“aS”] = 880
tones[“cS”] = 523
tones[“eS”] = 659

function beep(pin, tone, duration)
local freq = tones[tone]
print (“Frequency:” .. freq)
pwm.setup(pin, freq, 512)
pwm.start(pin)
— delay in uSeconds
tmr.delay(duration * 1000)
pwm.stop(pin)
–20ms pause
tmr.wdclr()
tmr.delay(20000)
end

function play()
beep(buzzerPin, “cS”, 100)
beep(buzzerPin, “eS”, 100)
beep(buzzerPin, “aS”, 100)
end

tmr.alarm(0, 3000, 1, function() play() end )

WiFi Listeleme

  • 3 sene önce, Burak Çalışkan tarafından yazılmıştır.
  • 0 Yorum
  • Lua

function listap(t) — (SSID : Authmode, RSSI, BSSID, Channel)
print(“\n”..string.format(“%32s”,”SSID”)..”\tBSSID\t\t\t\t RSSI\t\tAUTHMODE\tCHANNEL”)
for ssid,v in pairs(t) do
local authmode, rssi, bssid, channel = string.match(v, “([^,]+),([^,]+),([^,]+),([^,]+)”)
print(string.format(“%32s”,ssid)..”\t”..bssid..”\t “..rssi..”\t\t”..authmode..”\t\t\t”..channel)
end
end
wifi.sta.getap(listap)