Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.
Dependencies: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Diff: main.cpp
- Revision:
- 12:6cd135bf03bd
- Parent:
- 11:1539d181e159
- Child:
- 13:711f74b2fa33
--- a/main.cpp Sat Sep 22 10:24:14 2012 +0000 +++ b/main.cpp Sun Feb 03 04:53:44 2013 +0000 @@ -1,38 +1,40 @@ #include "LPC17xx.h" #include "mbed.h" -#include "PWM.h" -#include "Motion.h" +#include "Motions.h" -Ticker tick; -PWM pwm; +uint16_t data[0x2000] __attribute__((section("AHBSRAM1"))); //motion data area +Ticker tick; //Ticker for main control roop int main(void) { - unsigned short int size_x = 400; //max about 25kb - unsigned char size_y = 25; + unsigned short int size_x = 25; //max about 25kb + unsigned short int size_y = 400; uint16_t **array = new uint16_t*[size_x]; - for (int i = 0; i < size_x; ++i) { - array[i] = new uint16_t[size_y]; - } - for (int i = 0; i < size_x; ++i) { - for (int j = 0; j < size_y; ++j) { - array[i][j] = 900 + 2*i; - } - } - for (int i = 0; i < size_x; ++i) { - array[i][size_y - 1] = 1; - } - - Motion inter0(array, size_x, size_y); + for (int i = 0; i < size_y; ++i) { + array[i] = new uint16_t[size_x]; + } + for (int i = 0; i < size_y; ++i) { + for (int j = 0; j < size_x; ++j) { + array[i][j] = 900 + 2*i; + } + } + for (int i = 0; i < size_y; ++i) { + array[i][size_x - 1] = 1; + } - //tick.attach(&inter0, &Motion::step, 0.02); + Motion inter0(array, size_y, size_x); + //int data[256]; + //CSV csv; + //csv.readCSV("data.csv", data); + + //Motions motions(data); while (1) { - //int id = 0; + //motions.control(); if (!inter0.is_in_interrupt()) { tick.attach(&inter0, &Motion::step, 0.02); } - wait(0.05); + wait(5); } } \ No newline at end of file