Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenSource
Baitboat
Commits
3a986474
Commit
3a986474
authored
11 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
Plane: added RSSI_RANGE parameter
parent
6b12f13d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ArduPlane/Parameters.h
+2
-0
2 additions, 0 deletions
ArduPlane/Parameters.h
ArduPlane/Parameters.pde
+8
-0
8 additions, 0 deletions
ArduPlane/Parameters.pde
ArduPlane/sensors.pde
+8
-4
8 additions, 4 deletions
ArduPlane/sensors.pde
with
18 additions
and
4 deletions
ArduPlane/Parameters.h
+
2
−
0
View file @
3a986474
...
...
@@ -180,6 +180,7 @@ public:
k_param_rssi_pin
,
k_param_battery_volt_pin
,
// unused
k_param_battery_curr_pin
,
// unused - 169
k_param_rssi_range
,
//
// 170: Radio settings
...
...
@@ -411,6 +412,7 @@ public:
AP_Int8
flap_2_percent
;
AP_Int8
flap_2_speed
;
AP_Int8
rssi_pin
;
AP_Float
rssi_range
;
// allows to set max voltage for rssi pin such as 5.0, 3.3 etc.
AP_Int8
inverted_flight_ch
;
// 0=disabled, 1-8 is channel for inverted flight trigger
AP_Int8
stick_mixing
;
AP_Float
takeoff_throttle_min_speed
;
...
...
This diff is collapsed.
Click to expand it.
ArduPlane/Parameters.pde
+
8
−
0
View file @
3a986474
...
...
@@ -753,6 +753,14 @@ const AP_Param::Info var_info[] PROGMEM = {
// @User: Standard
GSCALAR
(
rssi_pin
,
"RSSI_PIN"
,
-
1
),
// @Param: RSSI_RANGE
// @DisplayName: Receiver RSSI voltage range
// @Description: Receiver RSSI voltage range
// @Units: Volt
// @Values: 3.3:3.3V, 5.0:5V
// @User: Standard
GSCALAR
(
rssi_range
,
"RSSI_RANGE"
,
5.0
),
// @Param: INVERTEDFLT_CH
// @DisplayName: Inverted flight channel
// @Description: A RC input channel number to enable inverted flight. If this is non-zero then the APM will monitor the correcponding RC input channel and will enable inverted flight when the channel goes above 1750.
...
...
This diff is collapsed.
Click to expand it.
ArduPlane/sensors.pde
+
8
−
4
View file @
3a986474
...
...
@@ -83,12 +83,16 @@ static void read_battery(void)
// RC_CHANNELS_SCALED message
void
read_receiver_rssi
(
void
)
{
rssi_analog_source
->
set_pin
(
g
.
rssi_pin
);
float
ret
=
rssi_analog_source
->
voltage_average
()
*
50
;
receiver_rssi
=
constrain_int16
(
ret
,
0
,
255
);
// avoid divide by zero
if
(
g
.
rssi_range
<=
0
)
{
receiver_rssi
=
0
;
}
else
{
rssi_analog_source
->
set_pin
(
g
.
rssi_pin
);
float
ret
=
rssi_analog_source
->
voltage_average
()
*
255
/
g
.
rssi_range
;
receiver_rssi
=
constrain_int16
(
ret
,
0
,
255
);
}
}
/*
return current_loc.alt adjusted for ALT_OFFSET
This is useful during long flights to account for barometer changes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment