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 frdm_tsi_slider by
Revision 3:483512a581c6, committed 2016-05-18
- Comitter:
- GustavoRPE
- Date:
- Wed May 18 19:40:32 2016 +0000
- Parent:
- 2:b13f658fd99f
- Commit message:
- teste
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Feb 23 18:32:55 2014 +0000 +++ b/main.cpp Wed May 18 19:40:32 2016 +0000 @@ -12,12 +12,56 @@ #error TARGET NOT DEFINED #endif + + int main(void) { - PwmOut led(LED_GREEN); - TSIAnalogSlider tsi(ELEC0, ELEC1, 40); - + PwmOut R(LED_RED); + PwmOut G(LED_GREEN); + PwmOut B(LED_BLUE); + TSIAnalogSlider tsi(ELEC0, ELEC1, 1); + R = 1; + G = 1; + B = 1; + int x = 0; + while (true) { - led = 1.0 - tsi.readPercentage(); - wait(0.1); + //led = 1.0 - tsi.readPercentage(); + + + while (x == 0) { + x = tsi.readPercentage()*10; + wait(0.01); + } + + if (x > 1) { //High Temperature + //- tsi.readPercentage(); + R = 0; + //G = 1; + //B = 1; + while (x != 0) { + x = tsi.readPercentage()*10; + wait(0.01); + } + } + + while (x == 0) { + x = tsi.readPercentage()*10; + wait(0.01); + } + + if (x > 1) { //High Temperature + //- tsi.readPercentage(); + //x = 0; + R = 1; + //G = 1; + //B = 1; + while (x != 0) { + x = tsi.readPercentage()*10; + wait(0.01); + } + + } + + } }