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: LocalPositionSystem MMA8451Q Motor_Driver Sensors mbed
Fork of TDP_main by
Revision 10:c9212bbfeae6, committed 2015-02-25
- Comitter:
- Joseph_Penikis
- Date:
- Wed Feb 25 16:55:23 2015 +0000
- Parent:
- 9:718987b106a8
- Child:
- 11:9e56d52485d1
- Commit message:
- Been testing Motor_Driver
Changed in this revision
--- a/Motor_Driver.lib Mon Feb 23 16:49:59 2015 +0000 +++ b/Motor_Driver.lib Wed Feb 25 16:55:23 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/Yelfie/code/Motor_Driver/#ac8820db595c +http://developer.mbed.org/teams/Yelfie/code/Motor_Driver/#0b1858f43c33
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sensors.lib Wed Feb 25 16:55:23 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/Yelfie/code/Sensors/#f9f0b92a9d7c
--- a/main.cpp Mon Feb 23 16:49:59 2015 +0000
+++ b/main.cpp Wed Feb 25 16:55:23 2015 +0000
@@ -15,17 +15,20 @@
#include "mbed.h"
-#include "sensor_measure.h"
+//#include "sensor_measure.h"
#include "Motor_Driver.h"
//#include "Sensors.h"
#define PWM_PERIOD_US 10000
+DigitalOut led(LED1);
-Serial pc(USBTX, USBRX);
+//Serial pc(USBTX, USBRX);
-Timer MeasureTimer; //Timer used for measurement
+//Timer MeasureTimer; //Timer used for measurement
+
+Motor_Driver motors(PTD4, PTA12, PTA4, PTA5, PTC9, PTC8, PWM_PERIOD_US);
/* For deleting
double measure1 (){
@@ -56,37 +59,54 @@
}
*/
-int main() {
+int main() {
+ motors.setSpeed(0.5f);
+ motors.forward();
+ wait(1);
+ motors.start(0);
+ led = 0;
- /*
- Motor_Driver motors(PTD4, PTA12, PTA4, PTA5, PTC9, PTC8, PWM_PERIOD_US);
+ wait(2);
motors.setSpeed(1.0f);
- motors.forward();
- motors.start();
+
+ wait(2);
+
+ led = 1;
+
+ motors.stop(0);
wait(3);
- motors.stop()
motors.reverse();
- wait(200ms);
+ wait_ms(200);
- motors.start();
- */
- // setup_counter(1000, 0);
- // float frequency = measure_frequency(CHANNEL_1);
+ motors.start(0);
+ wait(3);
+ motors.stop(0);
- sensor_initialise(); // initialise sensor values
- wait(1); //give time to set up the system
+ motors.setSteeringMode(PIVOT_CW);
- sensorTimer.start(); // start timer for sensors
- pc.printf("Start...");
- MeasureTimer.start();
+ wait(1);
+ motors.start(0);
+ wait(2);
+ motors.stop(0);
+}
+
+/*int main()
+{
+ pc.baud(9600);
+
+ start_systick();
- while (1) {
- MeasureTimer.reset();
- measure(right_right);
- pc.printf("Time taken for the whole thing is %f",MeasureTimer.read());
- }
-
-}
+ pc.printf("Started!");
+
+ int frequency;
+
+ while(1)
+ {
+ frequency = measure_clock_cycles(CHANNEL_1, 25);
+ pc.printf("Debug: %i\n", frequency);
+ wait_ms(200);
+ }
+}*/
