Controlor for Humanoid. Walking trajectory generator, sensor reflection etc.

Dependencies:   Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed

Committer:
syundo0730
Date:
Sun Feb 03 21:22:21 2013 +0000
Revision:
13:711f74b2fa33
Parent:
12:6cd135bf03bd
Child:
14:522bb06f0f0d
play motion by signal from serial port

Who changed what in which revision?

UserRevisionLine numberNew contents of line
syundo0730 0:d114194bff43 1 #include "LPC17xx.h"
syundo0730 0:d114194bff43 2 #include "mbed.h"
syundo0730 12:6cd135bf03bd 3 #include "Motions.h"
syundo0730 0:d114194bff43 4
syundo0730 12:6cd135bf03bd 5 uint16_t data[0x2000] __attribute__((section("AHBSRAM1"))); //motion data area
syundo0730 12:6cd135bf03bd 6 Ticker tick; //Ticker for main control roop
syundo0730 5:0ca9f1bc1fb0 7
syundo0730 13:711f74b2fa33 8
syundo0730 8:72b4a248d469 9 int main(void)
syundo0730 8:72b4a248d469 10 {
syundo0730 13:711f74b2fa33 11 /*unsigned short int size_x = 25; //max about 25kb
syundo0730 13:711f74b2fa33 12 unsigned short int size_y = 5;
syundo0730 0:d114194bff43 13
syundo0730 11:1539d181e159 14 uint16_t **array = new uint16_t*[size_x];
syundo0730 12:6cd135bf03bd 15 for (int i = 0; i < size_y; ++i) {
syundo0730 12:6cd135bf03bd 16 array[i] = new uint16_t[size_x];
syundo0730 12:6cd135bf03bd 17 }
syundo0730 12:6cd135bf03bd 18 for (int i = 0; i < size_y; ++i) {
syundo0730 12:6cd135bf03bd 19 for (int j = 0; j < size_x; ++j) {
syundo0730 13:711f74b2fa33 20 array[i][j] = 900 + 200*i;
syundo0730 12:6cd135bf03bd 21 }
syundo0730 12:6cd135bf03bd 22 }
syundo0730 12:6cd135bf03bd 23 for (int i = 0; i < size_y; ++i) {
syundo0730 13:711f74b2fa33 24 array[i][size_x - 1] = 50;
syundo0730 12:6cd135bf03bd 25 }
syundo0730 9:d9ce965299d2 26
syundo0730 13:711f74b2fa33 27 Motion inter0(array, size_y, size_x);*/
syundo0730 12:6cd135bf03bd 28
syundo0730 13:711f74b2fa33 29 Motions motions(data);
syundo0730 13:711f74b2fa33 30 //motions.setmotion(0);
syundo0730 1:5c2e40445778 31
syundo0730 5:0ca9f1bc1fb0 32 while (1) {
syundo0730 13:711f74b2fa33 33 motions.control();
syundo0730 13:711f74b2fa33 34 //if (!inter0.is_in_interrupt()) {
syundo0730 13:711f74b2fa33 35 //tick.attach(&inter0, &Motion::step, 0.02);
syundo0730 13:711f74b2fa33 36 //}
syundo0730 13:711f74b2fa33 37 wait(0.05);
syundo0730 5:0ca9f1bc1fb0 38 }
syundo0730 10:be8b10e54ecb 39 }