hhh

Dependencies:   mbed

Committer:
2bv14ei073
Date:
Thu Dec 01 06:06:30 2016 +0000
Revision:
0:5d419a46e629
timer

Who changed what in which revision?

UserRevisionLine numberNew contents of line
2bv14ei073 0:5d419a46e629 1 #include "Timer.h"
2bv14ei073 0:5d419a46e629 2 #include "mbed.h"
2bv14ei073 0:5d419a46e629 3
2bv14ei073 0:5d419a46e629 4 Blinking::Blinking(PinName pin) : _pin(pin) {
2bv14ei073 0:5d419a46e629 5 _pin = 0;
2bv14ei073 0:5d419a46e629 6 }
2bv14ei073 0:5d419a46e629 7
2bv14ei073 0:5d419a46e629 8 void Blinking::blink(int n) {
2bv14ei073 0:5d419a46e629 9 for(int i=0; i<n*2; i++) {
2bv14ei073 0:5d419a46e629 10 _pin = !_pin;
2bv14ei073 0:5d419a46e629 11 wait(0.2);
2bv14ei073 0:5d419a46e629 12 }
2bv14ei073 0:5d419a46e629 13 }