flash one led

Committer:
RT
Date:
Sat Jan 22 16:43:57 2022 +0000
Revision:
0:e57fe805caef
flash the led;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RT 0:e57fe805caef 1 //Flasher.cpp
RT 0:e57fe805caef 2
RT 0:e57fe805caef 3 #include "Flasher.h"
RT 0:e57fe805caef 4 #include "mbed.h"
RT 0:e57fe805caef 5
RT 0:e57fe805caef 6 Flasher::Flasher(PinName pin) : _pin(pin) {
RT 0:e57fe805caef 7 _pin = 0;
RT 0:e57fe805caef 8 }
RT 0:e57fe805caef 9
RT 0:e57fe805caef 10 void Flasher::flash(int n) {
RT 0:e57fe805caef 11 for(int i=0; i<n*2; i++) {
RT 0:e57fe805caef 12 _pin = !_pin;
RT 0:e57fe805caef 13 wait(0.2);
RT 0:e57fe805caef 14 }
RT 0:e57fe805caef 15 }