Commit f2297dc7 authored by Jorge's avatar Jorge
Browse files

Merge branch 'master' of gitlab.fing.edu.uy:robotito/firmware

parents 59e98ddc 30c1a340
......@@ -21,13 +21,14 @@ if runonce then
dofile(runonce)
else
print ("No run-once program set.")
print("Looking for a main program into nvs('autorun', 'main')")
local main = nvs.read("autorun", "main", nil)
if main then
print("Main program:", main)
dofile(main)
else
print ("No main program set.")
end
end
print("Looking for a main program into nvs('autorun', 'main')")
local main = nvs.read("autorun", "main", nil)
if main then
print("Main program:", main)
dofile(main)
else
print ("No main program set.")
end
\ No newline at end of file
......@@ -26,7 +26,7 @@ local hsm
-- initialize debugging
do
local debuggername = nvs.read("ahsm", "debugger", "debug_plain")
local debuggername = nvs.read("ahsm", "debugger", nil)
print('main_ahsm debugger:', debuggername)
if debuggername then
local debugger = require( debuggername )
......
......@@ -15,7 +15,7 @@ local onoff = require 'states.onoff'
local remotecontrol = require 'states.remotecontrol'
local behavior_name = nvs.read("ahsm", "behavior", nil) or nil
local behavior_name = nvs.read("ciceaapp", "behavior", nil) or nil
print('behavior loading:', behavior_name)
local behavior = ahsm.state{
......
......@@ -95,7 +95,7 @@ local s_color = ahsm.state {
exit = function ()
ledr.clear()
robot.omni.drive(0, 0, 0)
s_color.enable(false)
color.enable(false)
color.color_cb.remove(produce_color_event)
end,
}
......
......@@ -42,7 +42,16 @@ local t_command = ahsm.transition {
robot.omni.drive(xdot,ydot,w)
end
end -- Mas comandos con else if
else
if data[1] == 'nvswrite' then
local namespace = data[2]
local variable = data[3]
local value = data[4]
local type = data[5]
if type=='number' then value=tonumber(value) end
if type=='nil' then value=nil end
nvs.write(namespace, variable, value)
end
else
robot.hsm.queue_event(e_fin)
end
end
......
......@@ -30,6 +30,7 @@ $MODULES_DIR/proximity.lua
$MODULES_DIR/robot.lua
$MODULES_DIR/wifi_net.lua
$TEST_DIR/states/test.lua
$MODULES_AHSM_DIR/ciceaapp.lua
$MODULES_AHSM_DIR/onoff.lua
$MODULES_AHSM_DIR/colorway.lua
$MODULES_AHSM_DIR/color.lua
......@@ -63,6 +64,7 @@ proximity.lua
robot.lua
wifi_net.lua
states/test.lua
states/ciceaapp.lua
states/onoff.lua
states/colorway.lua
states/color.lua
......
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