check wait start function and end function

Dependencies:   mbed

main.cpp

Committer:
thirawat
Date:
2016-12-03
Revision:
0:5fde9944d50c

File content as of revision 0:5fde9944d50c:

#include "mbed.h"

PwmOut mypwm(PWM_OUT);

DigitalOut myled(LED1);

void check_end(){
    int sub_end = 0;
    for(int i=0;i<=16;i++){
        if(ship_underATK[i]!=0){
            sub_end++;
            }
        if(sub_end==15){
            bt.putc('q');
            }
        }
}

void check_waiting_start(){
    if(bt.readable()){
        if(bt.getc()=='W'){
            check_wait = 1;
            pc.printf("joe");
            }
        }
    }

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