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: F7_Ethernet mbed HTS221 LPS22HB LSM303AGR LSM6DSL
Fork of Nucleo_F746ZG_Ethernet by
Diff: main.cpp
- Revision:
- 5:32078e9590f0
- Parent:
- 4:04c17d376d57
- Child:
- 6:21fb4863e28d
--- a/main.cpp Fri Jan 26 09:53:50 2018 +0000
+++ b/main.cpp Wed Jan 31 10:18:24 2018 +0000
@@ -29,7 +29,7 @@
acc_gyro->set_x_odr(208.0f);
acc_gyro->set_g_odr(208.0f);
acc_gyro->set_x_fs(2.0f);
- acc_gyro->set_g_odr(125.0f);
+ acc_gyro->set_g_fs(125.0f);
//cpose per comunicazioni
const char * IP = "169.254.112.124";
@@ -41,7 +41,7 @@
EthernetInterface eth;
eth.init(IP,MASK,GATEWAY); //Use DHCP
eth.connect();
- printf("IP Address is %s\n", eth.getIPAddress());
+ printf("IP Address is %s\n\r", eth.getIPAddress());
@@ -75,8 +75,8 @@
int n = server.receiveFrom(client, buffer, sizeof(buffer));
buffer[n] = '\0';
- printf("Received packet from: %s\n", client.get_address());
- printf("Packet contents : '%s'\n",buffer);
+ printf("Received packet from: %s\n\r", client.get_address());
+ printf("Packet contents : '%s'\n\r",buffer);
@@ -109,9 +109,9 @@
acc_gyro->get_x_axes(axes);
acc_gyro->get_g_axes(axes2);
- offsetGX=offsetGX+ axes[0];
- offsetGY=offsetGY+ axes[1];
- offsetGZ=offsetGZ+ axes[2];
+ //offsetGX=offsetGX+ axes[0];
+ //offsetGY=offsetGY+ axes[1];
+ //offsetGZ=offsetGZ+ axes[2];
offsetAX=offsetAX+ axes2[0];
offsetAY=offsetAY+ axes2[1];
@@ -123,9 +123,9 @@
}
- offsetGX=offsetGX/counter;
- offsetGY=offsetGY/counter;
- offsetGZ=offsetGZ/counter;
+ //offsetGX=offsetGX/counter;
+ //offsetGY=offsetGY/counter;
+ //offsetGZ=offsetGZ/counter;
offsetAX=offsetAX/counter;
offsetAY=offsetAY/counter;
offsetAZ=offsetAZ/counter;
@@ -134,7 +134,7 @@
- printf("Start Sending Imu messages\n");
+ printf("Start Sending Imu messages\n\r");
myled3=1;
server.sendTo(client, buffer, n);
@@ -148,8 +148,8 @@
memset (&buffer[0], '\0', sizeof(buffer));
acc_gyro->get_x_axes(axes);
acc_gyro->get_g_axes(axes2);
- sprintf(buffer, "%ld,%ld,%ld,%ld,%ld,%ld\n", (axes[0]-offsetGX), (axes[1]-offsetGY), (axes[2]-offsetGZ), (axes2[0]-offsetAX), (axes2[1]-offsetAY), (axes2[2]-offsetAZ));
- //printf (buffer);
+ sprintf(buffer, "%6ld,%6ld,%6ld,%6ld,%6ld,%6ld\n\r", (((axes[0]-offsetGX)/1000)*9.806), (((axes[1]-offsetGY)/1000)*9.806), (((axes[2]-offsetGZ)/1000)*9.806), (((axes2[0]-offsetAX)/1000)*0.0174533), (((axes2[1]-offsetAY)/1000)*0.0174533), (((axes2[2]-offsetAZ)/1000)*0.0174533));
+ // printf (buffer);
n =sizeof (buffer);
server.sendTo(client, buffer, n);
//wait (1);
