Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Software Defined Radio
r0tor
Commits
4b08b578
Commit
4b08b578
authored
Jul 09, 2019
by
markus
Browse files
Refactor commands
parent
53882e88
Changes
2
Hide whitespace changes
Inline
Side-by-side
shackremote_arduino/control.cpp
View file @
4b08b578
...
...
@@ -42,7 +42,7 @@ void Control::doControl()
if
(
debugTime_
>
100
)
{
//hamlib.debugOut();
rotor_
->
debugOut
();
//
rotor_->debugOut();
debugTime_
=
0
;
}
debugTime_
++
;
...
...
@@ -64,25 +64,25 @@ Control::hamlibError Control::executeCommandString(String *command_string, Commu
// GNAAAARRR
communicator
->
sendMessage
(
String
(
String
(
AZIM_MIN
)
+
"/"
+
String
(
AZIM_MAX
)
+
" "
+
String
(
ELEV_MIN
)
+
"/"
+
String
(
ELEV_MAX
)));
}
else
if
(
substring
==
"get
pos
ition
"
)
{
else
if
(
substring
==
"getpos"
)
{
// GNAAAARRR
communicator
->
sendMessage
(
String
(
rotor_
->
getActualAzimuth
())
+
"
"
+
String
(
rotor_
->
getActualElevation
()));
communicator
->
sendMessage
(
String
(
rotor_
->
getActualAzimuth
())
+
"
.00;
"
+
String
(
rotor_
->
getActualElevation
())
+
".00;"
);
}
else
if
(
substring
.
startsWith
(
"set
az"
)
)
{
if
(
substring
.
length
()
<
8
)
else
if
(
substring
.
startsWith
(
"setaz"
)
)
{
if
(
substring
.
length
()
<
7
)
return
HAMLIB_NOK
;
dst
=
substring
.
substring
(
7
).
to
In
t
();
if
(
dst
==
0
&&
substring
.
substring
(
7
)
!=
"0"
)
dst
=
(
int
)
substring
.
substring
(
5
).
to
Floa
t
();
if
(
dst
==
0
&&
substring
.
substring
(
5
)
!=
"0"
)
return
HAMLIB_NOK
;
if
(
dst
<
AZIM_MIN
or
dst
>
AZIM_MAX
)
return
HAMLIB_NOK
;
rotor_
->
setAzimuth
(
dst
);
}
else
if
(
substring
.
startsWith
(
"set
el"
)
)
{
if
(
substring
.
length
()
<
8
)
else
if
(
substring
.
startsWith
(
"setel"
)
)
{
if
(
substring
.
length
()
<
7
)
return
HAMLIB_NOK
;
dst
=
substring
.
substring
(
7
).
to
In
t
();
if
(
dst
==
0
&&
substring
.
substring
(
7
)
!=
"0"
)
dst
=
(
int
)
substring
.
substring
(
5
).
to
Floa
t
();
if
(
dst
==
0
&&
substring
.
substring
(
5
)
!=
"0"
)
return
HAMLIB_NOK
;
if
(
dst
<
ELEV_MIN
or
dst
>
ELEV_MAX
)
return
HAMLIB_NOK
;
...
...
shackremote_arduino/shackremote_arduino.ino
View file @
4b08b578
...
...
@@ -52,8 +52,8 @@ void setup()
//rotor.releaseBreakAzimuth();
//rotor.releaseBreakElevation();
//rotor.rotateUp();
control
.
setElevation
(
23
);
control
.
setAzimuth
(
42
);
//
control.setElevation(23);
//
control.setAzimuth(42);
}
void
loop
()
...
...
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