![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
ESE350 project, Spring 2016, University of Pennsylvania
Dependencies: Adafruit9-DOf Receiver mbed-rtos mbed
Diff: main.cpp
- Revision:
- 6:6f3ffd97d808
- Parent:
- 5:f007542f1dab
- Child:
- 7:f3f94eadc5b5
--- a/main.cpp Sat Apr 02 12:40:04 2016 +0000 +++ b/main.cpp Sat Apr 02 13:13:41 2016 +0000 @@ -13,20 +13,15 @@ Serial pc(USBTX, USBRX); -// pwm outputs for the 4 motors +// pwm outputs for the 4 motors (motor 1 points into x direction, 2 into y direction, 3 -x direction, -y direction PwmOut motor_1(p21); PwmOut motor_2(p22); PwmOut motor_3(p23); PwmOut motor_4(p24); - - - - - int main() { - control result; + control result; offset offset_gyro; initSensors(accel, mag, gyro,offset_gyro); @@ -36,10 +31,10 @@ sensors_event_t gyro_event; sensors_vec_t orientation; - motor_1.period(0.002); // servo requires a 2ms period - motor_2.period(0.002); // servo requires a 2ms period - motor_3.period(0.002); // servo requires a 2ms period - motor_4.period(0.002); // servo requires a 2ms period + motor_1.period(0.002); // motor requires a 2ms period + motor_2.period(0.002); // motor requires a 2ms period + motor_3.period(0.002); // motor requires a 2ms period + motor_4.period(0.002); // motor requires a 2ms period // pwm duty cycles for the 4 motors motor_1 = 0; @@ -48,7 +43,6 @@ motor_4 = 0; // startup procedure - pc.printf("Type 's' to start up Motors, or anything else to abort.\n\r"); char a= pc.getc(); if (a!='s') {