BertlBlinkDemo

Dependencies:   BertlLib mbed

Fork of BertlTemplate2 by michael hollegha

Committer:
hollegha2
Date:
Wed Mar 08 10:18:36 2017 +0000
Revision:
5:a6f2a5a74760
V1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hollegha2 5:a6f2a5a74760 1
hollegha2 5:a6f2a5a74760 2 #include "mbed.h"
hollegha2 5:a6f2a5a74760 3 #include "Serial_HL.h"
hollegha2 5:a6f2a5a74760 4 #include "Bertl14.h"
hollegha2 5:a6f2a5a74760 5 #include "BertlObjects.h"
hollegha2 5:a6f2a5a74760 6
hollegha2 5:a6f2a5a74760 7 // nur bei den neuen Bertls
hollegha2 5:a6f2a5a74760 8 // main=2^0 LS ENC 2^2
hollegha2 5:a6f2a5a74760 9 BusOut boardPow(p30, P1_6, P1_7);
hollegha2 5:a6f2a5a74760 10
hollegha2 5:a6f2a5a74760 11 void BlinkTask();
hollegha2 5:a6f2a5a74760 12 Timer t1;
hollegha2 5:a6f2a5a74760 13
hollegha2 5:a6f2a5a74760 14 int main(void)
hollegha2 5:a6f2a5a74760 15 {
hollegha2 5:a6f2a5a74760 16 boardPow=1; wait_ms(10);
hollegha2 5:a6f2a5a74760 17 InitBertl();
hollegha2 5:a6f2a5a74760 18 pex.useISR=0; leds=9;
hollegha2 5:a6f2a5a74760 19 pex.ClearLeds();
hollegha2 5:a6f2a5a74760 20 t1.start();
hollegha2 5:a6f2a5a74760 21
hollegha2 5:a6f2a5a74760 22 while(1)
hollegha2 5:a6f2a5a74760 23 {
hollegha2 5:a6f2a5a74760 24 BlinkTask();
hollegha2 5:a6f2a5a74760 25
hollegha2 5:a6f2a5a74760 26 //
hollegha2 5:a6f2a5a74760 27
hollegha2 5:a6f2a5a74760 28 //
hollegha2 5:a6f2a5a74760 29 }
hollegha2 5:a6f2a5a74760 30 return 1;
hollegha2 5:a6f2a5a74760 31 }
hollegha2 5:a6f2a5a74760 32
hollegha2 5:a6f2a5a74760 33 void BlinkTask()
hollegha2 5:a6f2a5a74760 34 {
hollegha2 5:a6f2a5a74760 35 if( t1.read_ms()>100 ) { // alle 100ms = 10Hz
hollegha2 5:a6f2a5a74760 36 t1.reset(); // timer neu starten
hollegha2 5:a6f2a5a74760 37 pex.ToggleLeds(LED_FL1|LED_FL2|LED_FR1|LED_FR2);
hollegha2 5:a6f2a5a74760 38 }
hollegha2 5:a6f2a5a74760 39 }
hollegha2 5:a6f2a5a74760 40
hollegha2 5:a6f2a5a74760 41
hollegha2 5:a6f2a5a74760 42
hollegha2 5:a6f2a5a74760 43
hollegha2 5:a6f2a5a74760 44