Commit 7c74966b authored by Guillermo Amorin's avatar Guillermo Amorin
Browse files
parents c59dcd5f f93c90b5
......@@ -28,6 +28,8 @@ ahsm.get_time = os.gettime
local debugger = require 'debug_plain'
--ahsm.debug = debugger.out
local SECURITY_V = 5
local hsm
local n_colors = #colors
......@@ -95,6 +97,9 @@ local function create_calibrator (clr)
local s_capture_calibration = ahsm.state {
_name = 's_capture',
entry = function ()
if (cv < nvs.read('color','min_val',40)) then
nvs.write('color','min_val', cv-SECURITY_V)
end
print ('capturing', clr.name, ch, cs, cv)
nvs.write('color', clr.name..'_h', ch)
nvs.write('color', clr.name..'_s', cs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment