V1

Dependencies:   simple-mbed-client

Committer:
johnlynam2014
Date:
Tue Mar 07 12:57:42 2017 +0000
Revision:
1:bb3336b7e953
Parent:
0:94dec0f696e0
Mbed_1st_Commit_V1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
johnlynam2014 0:94dec0f696e0 1
johnlynam2014 0:94dec0f696e0 2 #define LED_TYPE_ANODE 1
johnlynam2014 0:94dec0f696e0 3 #define LED_TYPE_CATHODE 0
johnlynam2014 0:94dec0f696e0 4
johnlynam2014 0:94dec0f696e0 5 /*#define LED_RED D5
johnlynam2014 0:94dec0f696e0 6 #define LED_GREEN D6
johnlynam2014 0:94dec0f696e0 7 #define LED_BLUE D7
johnlynam2014 0:94dec0f696e0 8 #define PIN_PIR D2*/
johnlynam2014 0:94dec0f696e0 9
johnlynam2014 0:94dec0f696e0 10 void setIntensity(PwmOut led, float value) {
johnlynam2014 0:94dec0f696e0 11 #if LED_TYPE_ANODE == 1
johnlynam2014 0:94dec0f696e0 12 led = 1.0f - value;
johnlynam2014 0:94dec0f696e0 13 #elif LED_TYPE_CATHODE == 1
johnlynam2014 0:94dec0f696e0 14 led = value;
johnlynam2014 0:94dec0f696e0 15 #else
johnlynam2014 0:94dec0f696e0 16 printf("LED_TYPE should be ANODE or CATHODE\n");
johnlynam2014 0:94dec0f696e0 17 #endif
johnlynam2014 0:94dec0f696e0 18 }