creo que es otro ticker

Dependencies:   mbed

Committer:
Franmaver
Date:
Tue Apr 09 14:06:52 2019 +0000
Revision:
0:170563028efc
ya no me acuerdo cual es este. creo que sigue siendo ticker

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Franmaver 0:170563028efc 1 #include "mbed.h"
Franmaver 0:170563028efc 2 //Hacer la siguiente secuencia Rojo 0.1ON, 0.9OFF
Franmaver 0:170563028efc 3
Franmaver 0:170563028efc 4 DigitalOut myled(LED1);
Franmaver 0:170563028efc 5
Franmaver 0:170563028efc 6 Ticker maver;
Franmaver 0:170563028efc 7
Franmaver 0:170563028efc 8 void charin (){
Franmaver 0:170563028efc 9 static int i = 0;
Franmaver 0:170563028efc 10 myled = 1;
Franmaver 0:170563028efc 11 i++;
Franmaver 0:170563028efc 12 if(i == 9){
Franmaver 0:170563028efc 13 myled = 0;
Franmaver 0:170563028efc 14 i = 0;
Franmaver 0:170563028efc 15 }
Franmaver 0:170563028efc 16
Franmaver 0:170563028efc 17 }
Franmaver 0:170563028efc 18
Franmaver 0:170563028efc 19 int main() {
Franmaver 0:170563028efc 20
Franmaver 0:170563028efc 21 maver.attach (&charin, 0.1);
Franmaver 0:170563028efc 22
Franmaver 0:170563028efc 23 while(1) {
Franmaver 0:170563028efc 24 }
Franmaver 0:170563028efc 25 }