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
af121c49
Commit
af121c49
authored
13 years ago
by
Randy Mackay
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c3ea1ca5
7c0f39ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/AP_InertialSensor/examples/MPU6000/MPU6000.pde
+51
-0
51 additions, 0 deletions
libraries/AP_InertialSensor/examples/MPU6000/MPU6000.pde
libraries/AP_InertialSensor/examples/MPU6000/Makefile
+1
-0
1 addition, 0 deletions
libraries/AP_InertialSensor/examples/MPU6000/Makefile
with
52 additions
and
0 deletions
libraries/AP_InertialSensor/examples/MPU6000/MPU6000.pde
0 → 100644
+
51
−
0
View file @
af121c49
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
//
// Simple test for the AP_InertialSensor MPU6000 driver.
//
#include
<FastSerial.h>
#include
<Wire.h>
#include
<SPI.h>
#include
<Arduino_Mega_ISR_Registry.h>
#include
<AP_PeriodicProcess.h>
#include
<AP_InertialSensor.h>
#include
<AP_Math.h>
#include
<AP_Common.h>
FastSerialPort
(
Serial
,
0
);
Arduino_Mega_ISR_Registry
isr_registry
;
AP_TimerProcess
scheduler
;
AP_InertialSensor_MPU6000
ins
(
53
);
/* chip select is pin 53 */
void
setup
(
void
)
{
Serial
.
begin
(
115200
);
Serial
.
println
(
"Doing INS startup..."
);
Wire
.
begin
();
SPI
.
begin
();
SPI
.
setClockDivider
(
SPI_CLOCK_DIV16
);
// 1MHZ SPI rate
isr_registry
.
init
();
scheduler
.
init
(
&
isr_registry
);
ins
.
init
(
&
scheduler
);
}
void
loop
(
void
)
{
float
accel
[
3
];
float
gyro
[
3
];
float
temperature
;
delay
(
20
);
ins
.
update
();
ins
.
get_gyros
(
gyro
);
ins
.
get_accels
(
accel
);
temperature
=
ins
.
temperature
();
Serial
.
printf
(
"AX: %f AY: %f AZ: %f GX: %f GY: %f GZ: %f T=%f
\n
"
,
accel
[
0
],
accel
[
1
],
accel
[
2
],
gyro
[
0
],
gyro
[
1
],
gyro
[
2
],
temperature
);
}
This diff is collapsed.
Click to expand it.
libraries/AP_InertialSensor/examples/MPU6000/Makefile
0 → 100644
+
1
−
0
View file @
af121c49
include
../../../AP_Common/Arduino.mk
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