mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
parent
d365ab6645
commit
0101f753f9
1 changed files with 8 additions and 3 deletions
|
@ -3,6 +3,12 @@ function tab_initialize_sensors() {
|
||||||
GUI.active_tab = 'sensors';
|
GUI.active_tab = 'sensors';
|
||||||
|
|
||||||
$('#content').load("./tabs/sensors.html", function() {
|
$('#content').load("./tabs/sensors.html", function() {
|
||||||
|
// Always start with default/empty sensor data array, clean slate all
|
||||||
|
for (var i = 0; i < 3; i++) SENSOR_DATA.accelerometer[i] = 0;
|
||||||
|
for (var i = 0; i < 3; i++) SENSOR_DATA.gyroscope[i] = 0;
|
||||||
|
for (var i = 0; i < 3; i++) SENSOR_DATA.magnetometer[i] = 0;
|
||||||
|
for (var i = 0; i < 4; i++) SENSOR_DATA.debug[i] = 0;
|
||||||
|
|
||||||
// Setup variables
|
// Setup variables
|
||||||
var samples_gyro_i = 300;
|
var samples_gyro_i = 300;
|
||||||
var samples_accel_i = 300;
|
var samples_accel_i = 300;
|
||||||
|
@ -233,7 +239,7 @@ function tab_initialize_sensors() {
|
||||||
{data: baro_data[0], label: "X - meters [" + SENSOR_DATA.altitude.toFixed(2) + "]"} ], baro_options);
|
{data: baro_data[0], label: "X - meters [" + SENSOR_DATA.altitude.toFixed(2) + "]"} ], baro_options);
|
||||||
|
|
||||||
samples_baro_i++;
|
samples_baro_i++;
|
||||||
}, rates.baro, true);
|
}, rates.baro);
|
||||||
|
|
||||||
GUI.interval_add('debug_pull', function() {
|
GUI.interval_add('debug_pull', function() {
|
||||||
send_message(MSP_codes.MSP_DEBUG, MSP_codes.MSP_DEBUG);
|
send_message(MSP_codes.MSP_DEBUG, MSP_codes.MSP_DEBUG);
|
||||||
|
@ -247,7 +253,6 @@ function tab_initialize_sensors() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Flotr.draw(e_graph_debug1, [
|
Flotr.draw(e_graph_debug1, [
|
||||||
{data: debug_data[0], label: "debug1 [" + SENSOR_DATA.debug[0] + "]"} ], debug1_options);
|
{data: debug_data[0], label: "debug1 [" + SENSOR_DATA.debug[0] + "]"} ], debug1_options);
|
||||||
Flotr.draw(e_graph_debug2, [
|
Flotr.draw(e_graph_debug2, [
|
||||||
|
@ -258,7 +263,7 @@ function tab_initialize_sensors() {
|
||||||
{data: debug_data[3], label: "debug4 [" + SENSOR_DATA.debug[3] + "]"} ], debug4_options);
|
{data: debug_data[3], label: "debug4 [" + SENSOR_DATA.debug[3] + "]"} ], debug4_options);
|
||||||
|
|
||||||
samples_debug_i++;
|
samples_debug_i++;
|
||||||
}, rates.debug, true);
|
}, rates.debug);
|
||||||
|
|
||||||
// processing timers
|
// processing timers
|
||||||
GUI.interval_add('process_gyro', function() {
|
GUI.interval_add('process_gyro', function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue