Bismarck / Mbed 2 deprecated ESC_TEST_CODE

Dependencies:   mbed

main.cpp

Committer:
tsillen
Date:
2015-04-30
Revision:
0:40a2ad5e1ba6

File content as of revision 0:40a2ad5e1ba6:

#include "mbed.h"

PwmOut mypwm(A0);

DigitalOut myled(LED1);

int main() {
    
    mypwm.period_ms(20);    //20ms period voor esc
    mypwm.pulsewidth_us(1500); //neutraal voor cal
    wait(3);    //give esc cal neutral some time , this is just a random value
    mypwm.pulsewidth_us(1400); //reverse
    wait(1);
    mypwm.pulsewidth_us(1600); //forward
    wait(1);
    mypwm.pulsewidth_us(1500); //neutraal

    
// printf("pwm set to %.2f %%\n", mypwm.read() * 100);   
//    while(1) {
//        myled = !myled;
//        wait(1);
//    }
}