Øving 4.2 Arben og Adrian

Dependencies:   mbed

Committer:
Smashftw
Date:
Wed Sep 20 13:09:53 2017 +0000
Revision:
2:e9d2e03e1b8c
Parent:
1:31fe0557741c
?ving 4.3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Smashftw 0:0887fcb9e2eb 1 #include "mbed.h"
Smashftw 1:31fe0557741c 2 Ticker Mytick;
Smashftw 1:31fe0557741c 3 BusOut teller(LED1, LED2, LED3, LED4);
Smashftw 1:31fe0557741c 4 volatile int Countup = 0;
Smashftw 1:31fe0557741c 5
Smashftw 1:31fe0557741c 6 void myTickerFunc()
Smashftw 1:31fe0557741c 7 {
Smashftw 1:31fe0557741c 8 Countup++;
Smashftw 1:31fe0557741c 9 if(Countup == 16) {
Smashftw 1:31fe0557741c 10 Countup = 0;
Smashftw 1:31fe0557741c 11 }
Smashftw 1:31fe0557741c 12 }
Smashftw 0:0887fcb9e2eb 13 int main()
Smashftw 0:0887fcb9e2eb 14 {
Smashftw 1:31fe0557741c 15 Mytick.attach(&myTickerFunc, 2.0);
Smashftw 0:0887fcb9e2eb 16 while(1) {
Smashftw 2:e9d2e03e1b8c 17 teller = Countup; //telle
Smashftw 0:0887fcb9e2eb 18 }
Smashftw 0:0887fcb9e2eb 19 }
Smashftw 1:31fe0557741c 20