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: BNO055_fusion mbed
Fork of DEMO3 by
Diff: main.cpp
- Revision:
- 13:c62f975dfcfe
- Parent:
- 12:3b26fcc7da7e
- Child:
- 14:4839989ae907
--- a/main.cpp Wed Mar 23 16:25:48 2016 +0000
+++ b/main.cpp Wed Mar 23 18:12:47 2016 +0000
@@ -3,8 +3,8 @@
#include "WATCHDOG.h"
-#define SPEED_TURN_MIN 0.20
-#define SPEED_TURN_MAX 0.35
+#define SPEED_TURN_MIN 0.30
+#define SPEED_TURN_MAX 0.45
#define SPEED_FB_MIN 0.15
#define SPEED_FB_MAX 0.50
@@ -18,10 +18,6 @@
LOCALIZE loc(i2c1, i2c2, p26);
LOCALIZE_xya xya;
-DigitalIn sw1(p20);
-DigitalIn sw2(p19);
-DigitalIn sw3(p18);
-DigitalIn sw4(p17);
DigitalOut dir1(p15);
DigitalOut dir2(p16);
@@ -30,11 +26,6 @@
PwmOut motor2F(p23);
PwmOut motor2B(p24);
-DigitalOut led1(LED1);
-DigitalOut led2(LED2);
-DigitalOut led3(LED3);
-DigitalOut led4(LED4);
-
Ticker t;
bool flag=false;
@@ -54,19 +45,11 @@
motor2B=0;
//pc.printf("Initialized Localization: %d\n",loc.init());
t.attach(&send,1);
- sw1.mode(PullUp);
- sw2.mode(PullUp);
- sw3.mode(PullUp);
- sw4.mode(PullUp);
while(1) {
- led1=!sw1;
- led2=!sw2;
- led3=!sw3;
- led4=!sw4;
//loc.get_angle(&xya);
loc.get_xy(&xya);
//pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a);
- setAngle(170);
+ //setAngle(0);
wdt.kick();
}
}
