hezhian hezhain / Mbed 2 deprecated testofsw

Dependencies:   mbed stepper

main.cpp

Committer:
hezhian
Date:
2018-07-26
Revision:
0:157c302566e8

File content as of revision 0:157c302566e8:

#include "mbed.h"

//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------

Serial pc(PA_9, PA_10);
DigitalIn sw(PB_1);

int main()
{
    int i = 1;
    pc.printf("Hello World !\n");
    while(1) {
        wait(0.1);
        if (sw.read() == 0)
        {
            
        pc.printf("This program runs since %d seconds.\n", i++);
        }
    }
}