lion d1 miniでビルトインLEDブリンク成功
if my_timer thenmy_timerという変数の中に、すでにタイマーオブジェクトが存在している(nilではない)かどうかを確認しています。my_timer:unregister()
タイマーのカウントダウン(定期実行ループ)を停止し、登録を解除します。my_timer = nil
変数の中身を空っぽ(nil)にして、タイマーが使っていたメモリを完全に解放します。
ーーーーbuiltin led blinkーーーーーーーーーーーーーーーーーーーーーーー
led = nil
if my_timer then my_timer:unregister() my_timer = nil end
led = 4
gpio.mode(led, gpio.OUTPUT)
my_timer = tmr.create()
my_timer:register(1000, tmr.ALARM_AUTO, function()
if gpio.read(led) == gpio.HIGH then
gpio.write(led, gpio.LOW)
else
gpio.write(led, gpio.HIGH)
end
end)
my_timer:start()
https://nodemcu-build.com/ (オーダーメード) and use firware bin
https://www.limpkin.fr/index.php?post/2016/04/17/A-Small-Collection-of-NodeMCU-Lua-Scripts-for-Data-Collection :: to study myself
sudo apt update
sudo apt install esptool
esptool --port /dev/ie:ttyUSB0 --baud 460800 write_flash 0x00000 ie:firmware.bin---------------------------------------------
https://tomosoft.jp/design/?p=6810 :: esplorer-for-lua
--------------------------------------------------
can download the tool from ESPlorer to program ESP8266 and ESP32 chips with Lua on Ubuntu.
- Install Java: ESPlorer is a Java application. Open your terminal and install Java using
sudo apt updateandsudo apt install default-jre. - Download ESPlorer: Get the latest zip file from the official site.
- Extract the file: Unzip the downloaded archive to a folder of your choice.
- Run the program: Open a terminal in that folder and run
java -jar ESPlorer.jar.
0 件のコメント:
コメントを投稿