C++ file for display control
Dependencies: 4DGL mbed ConfigFile
Fork of 4DGLtest by
Diff: keyboard.cpp
- Revision:
- 8:dd258f9e24b0
- Parent:
- 7:779c5b8d3b14
- Child:
- 9:311b6676272d
--- a/keyboard.cpp Sat Jul 05 16:32:03 2014 +0000 +++ b/keyboard.cpp Wed Jul 09 07:52:00 2014 +0000 @@ -9,7 +9,7 @@ InterruptIn CDU_KB_INT( p5 ); //Set CDU keyboard interrupt line. I2C CDU_I2C(p28, p27); //I2C bus for keyboard/temp chip. -//CDU Keyboard LEDS (can be PWM driven also...) +//CDU Keyboard LEDS DigitalOut EXEC( p12 ); DigitalOut FAIL( p17 ); DigitalOut DSPY( p18 ); @@ -42,6 +42,7 @@ void CDU_SET_BGL_INTENSITY( int nVal=255 ) { + //This routine must be called 5-10x per second. Manual test to see what is pleasant to see //AnalogIn BGL_POT( p15 ); //background light control potmeter. Returns a value between 0.0 and 1.0 //PwmOut BGL_LED( p21 ); //PWM output //calculate required brightness in percentage from 0%-100% @@ -66,7 +67,7 @@ case 255: { //calculate percentage from potmeter value - BGL_LED.pulsewidth( 0.0 + 100*BGL_POT ); + BGL_LED = ( 0.0 + 100*BGL_POT ); } } }