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

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

main.cpp

Committer:
syundo0730
Date:
2012-09-22
Revision:
11:1539d181e159
Parent:
10:be8b10e54ecb
Child:
12:6cd135bf03bd

File content as of revision 11:1539d181e159:

#include "LPC17xx.h"
#include "mbed.h"
#include "PWM.h"
#include "Motion.h"

Ticker tick;
PWM pwm;

int main(void)
{  
    unsigned short int size_x = 400;    //max about 25kb
    unsigned char size_y = 25;
    
    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);
    
    //tick.attach(&inter0, &Motion::step, 0.02);
    
    while (1) {
        //int id = 0;
        if (!inter0.is_in_interrupt()) {
            tick.attach(&inter0, &Motion::step, 0.02);
        }
        wait(0.05);
    }
}