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.
Dependencies: mbed
Revision 3:b8aaacdd726e, committed 2015-11-17
- Comitter:
- jchari
- Date:
- Tue Nov 17 21:29:49 2015 +0000
- Parent:
- 2:6d058686efbf
- Child:
- 4:b4270fbde211
- Commit message:
- I'm so commited.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Mar 12 08:22:00 2015 +0000 +++ b/main.cpp Tue Nov 17 21:29:49 2015 +0000 @@ -3,22 +3,25 @@ AnalogIn analog_value(A0); DigitalOut led(LED1); +Serial pc(USBTX, USBRX); // tx, rx + int main() { float meas; - - printf("\nAnalogIn example\n"); - + pc.printf("AnalogIn example: "); while(1) { meas = analog_value.read(); // Converts and read the analog input value (value from 0.0 to 1.0) meas = meas * 3300; // Change the value to be in the 0 to 3300 range - printf("measure = %.0f mV\n", meas); - if (meas > 2000) { // If the value is greater than 2V then switch the LED on - led = 1; + pc.printf("measure = %.0f mV\r\n", meas); + if (meas >= 450 ) { // If the value is greater than 2V then switch the LED on + pc.printf("Thermistor is being worn\r\n"); } - else { - led = 0; + if (meas < 450) { // If the value is greater than 2V then switch the LED on + pc.printf("Thermistor is at room temperature\r\n"); } - wait(0.2); // 200 ms + /*if (meas <= 500 && meas >= 450) { // If the value is greater than 2V then switch the LED on + pc.printf("Thermistor is in cloth\r\n"); + }*/ + wait(1); // 200 ms } }
--- a/mbed.bld Thu Mar 12 08:22:00 2015 +0000 +++ b/mbed.bld Tue Nov 17 21:29:49 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file