Check this one ! mbos setup changed, WTX hor pos changed, no font style check, no checksum check
Dependencies: 4DGL MODSERIAL mbed mbos
Fork of CDU_Mbed_21 by
Diff: keyboard2.cpp
- Revision:
- 11:d60c746c097c
- Parent:
- 10:7e350a27f936
diff -r 7e350a27f936 -r d60c746c097c keyboard2.cpp --- a/keyboard2.cpp Sun Jul 20 20:11:24 2014 +0000 +++ b/keyboard2.cpp Mon Jul 21 14:24:15 2014 +0000 @@ -37,7 +37,7 @@ void CDU_KB_COMM_INIT() { //initialize communication with TCA84818 char cmd[2]; - + Key_led = 0; cmd[0] = REG_CFG; //pointer byte to CFG register cmd[1] = 0x01; //data for CFG register KE_IEN set to 1 if ( CDU_I2C.write(CDU_KB_ADRS,cmd, 2) == I2C_ACK ) //initiate write cycle and check for ACK @@ -158,19 +158,29 @@ //switch off backlighting BGL_LED = 0.0 ; LightOn = 0; + FullBright = 0; break; } case 100: { - //switch on backlighting + //switch on backlighting to normal BGL_LED = BGL_POT; LightOn = 1; + FullBright = 0; break; } + + case 128: + { + //switch backlighting to MAX + BGL_LED= 1; + FullBright = 1; + } + case 255: { //calculate percentage from potmeter value - if ( LightOn == 1) + if ( ( LightOn == 1) && (FullBright== 0) ) { if ( BGL_POT < 0.01 ) { @@ -181,6 +191,11 @@ BGL_LED = BGL_POT; } } + else if ( ( LightOn == 1) && (FullBright== 1) ) + { + BGL_LED = 1; + + } } } } \ No newline at end of file