Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lightsense_kl46z_PWM_simple by
Revision 9:cc1bae13d6be, committed 2017-02-05
- Comitter:
- sbart
- Date:
- Sun Feb 05 06:53:04 2017 +0000
- Parent:
- 8:ea818c9220fc
- Commit message:
- SB_HW_3-2
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jan 25 16:10:38 2016 +0000 +++ b/main.cpp Sun Feb 05 06:53:04 2017 +0000 @@ -7,8 +7,6 @@ #define LCDLEN 10 #define LIGHTSENSORPORT PTE22 - - SLCD slcd; //define LCD display globally define Serial pc(USBTX, USBRX); Timer LEDTimer; @@ -17,6 +15,8 @@ slcd.Home(); slcd.clear(); slcd.printf(lMess); + + slcd.DP(0, false); //Disables the decimal point in position 0 } int main() { @@ -35,14 +35,14 @@ while(true) { if (LEDTimer.read_ms() > timeToChangeDF){ // check for timer time out transtion - lightData = (1.0 - LightSensor.read()); // show as increasiing with increasing intensity - greenColor.write(1.0- lightData); - redColor.write(1.0-lightData); + lightData = (1.0 - LightSensor.read()) * 100; // show as increasiing with increasing intensity + greenColor.write(1.0 - lightData); + redColor.write(1.0 - lightData); sprintf(lcdData,"%4.3f",lightData); LCDMess(lcdData); pc.printf("%4.3f\r\n",lightData); timeToChangeDF = DATATIME; LEDTimer.reset(); } - }// emd while + }// end while }