Skip to content

Instantly share code, notes, and snippets.

View vsky279's full-sized avatar

Lukáš Voborský vsky279

View GitHub Profile
local FILE_READ_CHUNK = 1024
local _file = file
local file_exists, file_open = _file.exists, _file.open
local node_LFS_resource = node.LFS.resource -- luacheck: ignore
local file_lfs = {}
local function file_lfs_create (filename)
local content = node_LFS_resource(filename)
--
-- File: _init.lua
--[[
This is a template for the LFS equivalent of the SPIFFS init.lua.
It is a good idea to such an _init.lua module to your LFS and do most of the LFS
module related initialisaion in this. This example uses standard Lua features to
simplify the LFS API.
--------------------------------------------------------------------------------
-- DS18B20 one wire module for NODEMCU
-- by @voborsky, @devsaurus
--
-- by default the module is for integer version, comment integer version and
-- uncomment float version part for float version
--------------------------------------------------------------------------------
local modname = ...
local ow_setup, ow_search, ow_select, ow_read, ow_read_bytes, ow_write, ow_crc8, ow_reset, ow_reset_search =