Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Control_Yokutan_CANver1 XBusServo mbed mbed-rtos
Fork of ControlYokutan2017_2 by
Revision 72:aef1ec8c66c7, committed 2017-10-27
- Comitter:
- tsumagari
- Date:
- Fri Oct 27 09:51:52 2017 +0000
- Branch:
- mpu????????
- Parent:
- 71:a00561d455d1
- Child:
- 73:05feda5b0f98
- Commit message:
- pin????
Changed in this revision
| MPU6050.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MPU6050.h Sat Oct 21 06:52:10 2017 +0000
+++ b/MPU6050.h Fri Oct 27 09:51:52 2017 +0000
@@ -154,7 +154,7 @@
int Ascale = AFS_2G;
//Set up I2C, (SDA,SCL)
-I2C i2c(p28,p27);
+I2C i2c(p9,p10);
DigitalOut myled(LED1);
--- a/main.cpp Sat Oct 21 06:52:10 2017 +0000
+++ b/main.cpp Fri Oct 27 09:51:52 2017 +0000
@@ -29,7 +29,7 @@
#define debug pc.printf
-#define debugMPU //pc.printf
+#define debugMPU pc.printf
const char *configfilename = "/local/CONFIG.csv";
@@ -64,9 +64,6 @@
LocalFileSystem local("local");
-//Set up I2C, (SDA,SCL)
-I2C i2c_mpu(p9,p10);
-
char toSendDatas[TO_SEND_DATAS_NUM];
char floatValues[10];
float eruronTrim;
@@ -110,7 +107,7 @@
void MpuInit()
{
- i2c_mpu.frequency(400000); // use fast (400 kHz) I2C
+ i2c.frequency(400000); // use fast (400 kHz) I2C
t.start();
uint8_t whoami = mpu6050.readByte(MPU6050_ADDRESS, WHO_AM_I_MPU6050); // Read WHO_AM_I register for MPU-6050
if (whoami == 0x68) { // WHO_AM_I should always be 0x68
@@ -290,7 +287,7 @@
}
// toSendDatas[TO_SEND_DATAS_NUM - 1] = (char)(V/100);
toSendDatas[TO_SEND_DATAS_NUM - 1] = (char)V;
- pc.printf("test\n\r");
+ pc.printf("servoV:%f\n\r",V);
}
void receiveDatas()
