![](/media/cache/profiles/e5815151957be36ad2085b7a1a02c5cc.jpg.50x50_q85.jpg)
Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Diff: main.cpp
- Revision:
- 8:72b4a248d469
- Parent:
- 7:7c0621d33781
- Child:
- 9:d9ce965299d2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Sep 21 03:44:37 2012 +0000 @@ -0,0 +1,37 @@ +#include "LPC17xx.h" +#include "mbed.h" +#include "pwm.h" +#include <cmath> +#define M_PI 3.141592653589793238462643383279 + +void main_th(void); +//PWM pwm; + +int main(void) +{ + PWM pwm; + Ticker flip; + + pwm.InitPWM(); + flip.attach(&main_th,0.02); + + while (1) { + //SetDuty(1,SRV_MAX_DUTY); + //sleep(); + //__enable_irq(); + //__disable_irq(); + //NVIC_DisableIRQ(PWM1_IRQn); + } +} + +void main_th(void) { + PWM pwm; + //const uint32_t center = 1500 - 1; + //const uint32_t dif = SRV_MAX_DUTY - center; + static uint8_t i; + + __disable_irq(); + pwm.SetDuty(1,SRV_MIN_DUTY+i); + __enable_irq(); + ++i; +} \ No newline at end of file