Smart coffee machine with facial recognition and remote control
Dependencies: Camera_LS_Y201 EthernetInterface EthernetNetIf HTTPClient SRF05 TextLCD mbed-rtos mbed-src
led.cpp@0:43669f623d43, 2014-01-15 (annotated)
- Committer:
- projetmacintel
- Date:
- Wed Jan 15 11:09:52 2014 +0000
- Revision:
- 0:43669f623d43
dep?t final PAO Macintel
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
projetmacintel | 0:43669f623d43 | 1 | #include "led.h" |
projetmacintel | 0:43669f623d43 | 2 | |
projetmacintel | 0:43669f623d43 | 3 | DigitalOut led1(LED1); |
projetmacintel | 0:43669f623d43 | 4 | DigitalOut led2(LED2); |
projetmacintel | 0:43669f623d43 | 5 | DigitalOut led3(LED3); |
projetmacintel | 0:43669f623d43 | 6 | DigitalOut led4(LED4); |
projetmacintel | 0:43669f623d43 | 7 | |
projetmacintel | 0:43669f623d43 | 8 | void actionSurLed(int num, int val) |
projetmacintel | 0:43669f623d43 | 9 | { |
projetmacintel | 0:43669f623d43 | 10 | switch(num) |
projetmacintel | 0:43669f623d43 | 11 | { |
projetmacintel | 0:43669f623d43 | 12 | case 1: |
projetmacintel | 0:43669f623d43 | 13 | led1 = val; |
projetmacintel | 0:43669f623d43 | 14 | break; |
projetmacintel | 0:43669f623d43 | 15 | |
projetmacintel | 0:43669f623d43 | 16 | case 2: |
projetmacintel | 0:43669f623d43 | 17 | led2 = val; |
projetmacintel | 0:43669f623d43 | 18 | break; |
projetmacintel | 0:43669f623d43 | 19 | |
projetmacintel | 0:43669f623d43 | 20 | case 3: |
projetmacintel | 0:43669f623d43 | 21 | led3 = val; |
projetmacintel | 0:43669f623d43 | 22 | break; |
projetmacintel | 0:43669f623d43 | 23 | |
projetmacintel | 0:43669f623d43 | 24 | case 4: |
projetmacintel | 0:43669f623d43 | 25 | led4 = val; |
projetmacintel | 0:43669f623d43 | 26 | break; |
projetmacintel | 0:43669f623d43 | 27 | } |
projetmacintel | 0:43669f623d43 | 28 | } |
projetmacintel | 0:43669f623d43 | 29 | |
projetmacintel | 0:43669f623d43 | 30 | void allumerLed(int num) |
projetmacintel | 0:43669f623d43 | 31 | { |
projetmacintel | 0:43669f623d43 | 32 | actionSurLed(num, 1); |
projetmacintel | 0:43669f623d43 | 33 | } |
projetmacintel | 0:43669f623d43 | 34 | |
projetmacintel | 0:43669f623d43 | 35 | void eteindreLed(int num) |
projetmacintel | 0:43669f623d43 | 36 | { |
projetmacintel | 0:43669f623d43 | 37 | actionSurLed(num, 0); |
projetmacintel | 0:43669f623d43 | 38 | } |
projetmacintel | 0:43669f623d43 | 39 | |
projetmacintel | 0:43669f623d43 | 40 | void inverserLed(int num) |
projetmacintel | 0:43669f623d43 | 41 | { |
projetmacintel | 0:43669f623d43 | 42 | switch(num) |
projetmacintel | 0:43669f623d43 | 43 | { |
projetmacintel | 0:43669f623d43 | 44 | case 1: |
projetmacintel | 0:43669f623d43 | 45 | led1 = !led1; |
projetmacintel | 0:43669f623d43 | 46 | break; |
projetmacintel | 0:43669f623d43 | 47 | |
projetmacintel | 0:43669f623d43 | 48 | case 2: |
projetmacintel | 0:43669f623d43 | 49 | led2 = !led2; |
projetmacintel | 0:43669f623d43 | 50 | break; |
projetmacintel | 0:43669f623d43 | 51 | |
projetmacintel | 0:43669f623d43 | 52 | case 3: |
projetmacintel | 0:43669f623d43 | 53 | led3 = !led3; |
projetmacintel | 0:43669f623d43 | 54 | break; |
projetmacintel | 0:43669f623d43 | 55 | |
projetmacintel | 0:43669f623d43 | 56 | case 4: |
projetmacintel | 0:43669f623d43 | 57 | led4 = !led4; |
projetmacintel | 0:43669f623d43 | 58 | break; |
projetmacintel | 0:43669f623d43 | 59 | } |
projetmacintel | 0:43669f623d43 | 60 | } |