ga

Dependencies:   mbed

main.cpp

Committer:
changzhe8387
Date:
2015-01-20
Revision:
0:9d0719e821e4

File content as of revision 0:9d0719e821e4:

#include "mbed.h"
Serial pc(USBTX, USBRX);
PwmOut pwm1(p21);
PwmOut pwm2(p22);
int main(){
    while(1)
    int y=600;
    int x=500;
    int f;
    if(x-y>0){
    for(f = 1000;f < 3000;f+=10);
    pwm1.pulsewidth_us(f);
    }else if(x-y<0){
        for(f = 1000;f <2000;f+=10);
        pwm2.pulsewidth_us(f);
    }
    }