Runlight

Committer:
martwerl
Date:
Wed Jun 20 13:40:38 2018 +0000
Revision:
0:1836b0410ef1
Runlight

Who changed what in which revision?

UserRevisionLine numberNew contents of line
martwerl 0:1836b0410ef1 1 #include "mbed.h"
martwerl 0:1836b0410ef1 2 #include "LaufLicht.h"
martwerl 0:1836b0410ef1 3
martwerl 0:1836b0410ef1 4
martwerl 0:1836b0410ef1 5 void LaufLicht::ledOff(void)
martwerl 0:1836b0410ef1 6 {
martwerl 0:1836b0410ef1 7 _pin=0;
martwerl 0:1836b0410ef1 8 _pin2=0;
martwerl 0:1836b0410ef1 9 _pin3=0;
martwerl 0:1836b0410ef1 10 _pin4=0;
martwerl 0:1836b0410ef1 11 }
martwerl 0:1836b0410ef1 12
martwerl 0:1836b0410ef1 13 void LaufLicht::ledOn1(void)
martwerl 0:1836b0410ef1 14 {
martwerl 0:1836b0410ef1 15 _pin=1;
martwerl 0:1836b0410ef1 16 _pin2=0;
martwerl 0:1836b0410ef1 17 _pin3=0;
martwerl 0:1836b0410ef1 18 _pin4=0;
martwerl 0:1836b0410ef1 19 }
martwerl 0:1836b0410ef1 20
martwerl 0:1836b0410ef1 21 void LaufLicht::ledOn2(void)
martwerl 0:1836b0410ef1 22 {
martwerl 0:1836b0410ef1 23 _pin=0;
martwerl 0:1836b0410ef1 24 _pin2=1;
martwerl 0:1836b0410ef1 25 _pin3=0;
martwerl 0:1836b0410ef1 26 _pin4=0;
martwerl 0:1836b0410ef1 27 }
martwerl 0:1836b0410ef1 28
martwerl 0:1836b0410ef1 29 void LaufLicht::ledOn3(void)
martwerl 0:1836b0410ef1 30 {
martwerl 0:1836b0410ef1 31 _pin=0;
martwerl 0:1836b0410ef1 32 _pin2=0;
martwerl 0:1836b0410ef1 33 _pin3=1;
martwerl 0:1836b0410ef1 34 _pin4=0;
martwerl 0:1836b0410ef1 35 }
martwerl 0:1836b0410ef1 36
martwerl 0:1836b0410ef1 37 void LaufLicht::ledOn4(void)
martwerl 0:1836b0410ef1 38 {
martwerl 0:1836b0410ef1 39 _pin=0;
martwerl 0:1836b0410ef1 40 _pin2=0;
martwerl 0:1836b0410ef1 41 _pin3=0;
martwerl 0:1836b0410ef1 42 _pin4=1;
martwerl 0:1836b0410ef1 43 }
martwerl 0:1836b0410ef1 44
martwerl 0:1836b0410ef1 45 void LaufLicht::printStatus(void)
martwerl 0:1836b0410ef1 46 {
martwerl 0:1836b0410ef1 47 printf("Status Read:\nLED1 is now %d\nLED2 is now %d\n LED1 is now %d\n LED1 is now %d\n\n", _pin.read(), _pin2.read(), _pin3.read(), _pin4.read());
martwerl 0:1836b0410ef1 48 }
martwerl 0:1836b0410ef1 49