hello world

Dependencies:   mbed

main.cpp

Committer:
zef
Date:
2016-11-10
Revision:
1:b97739800353
Parent:
0:b43404785506

File content as of revision 1:b97739800353:

#include "mbed.h"

PwmOut mypwm(PWM_OUT);

DigitalOut myled(LED1);
DigitalIn myBt(USER_BUTTON);
Serial pc(USBTX,USBRX);
int main() {
    
    //mypwm.period_ms(10);
    //mypwm.pulsewidth_ms(1);
  
    //printf("pwm set to %.2f %%\n", mypwm.read() * 100);
    pc.baud(115200);
    printf("hello world!");//why is cant't printf????
    pc.printf("PChello world!\n");
    while(1) {
        if(myBt.read()==0)
        {
             myled = !myled;
             printf("hello world,system had passed%dms\n",(int)us_ticker_read());
        }
        //myled = !myled;
        wait(0.1);
    }
}