Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Santiago Ignacio Hitta Monteverde
firmware
Commits
f2297dc7
Commit
f2297dc7
authored
Jun 12, 2019
by
Jorge
Browse files
Merge branch 'master' of gitlab.fing.edu.uy:robotito/firmware
parents
59e98ddc
30c1a340
Changes
6
Hide whitespace changes
Inline
Side-by-side
source/autorun.lua
View file @
f2297dc7
...
...
@@ -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
source/main_ahsm.lua
View file @
f2297dc7
...
...
@@ -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
)
...
...
source/states/ciceaapp.lua
View file @
f2297dc7
...
...
@@ -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
{
...
...
source/states/color.lua
View file @
f2297dc7
...
...
@@ -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
,
}
...
...
source/states/remotecontrol.lua
View file @
f2297dc7
...
...
@@ -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
...
...
update.sh
View file @
f2297dc7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment