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 LM35 by
Revision 0:0604431a65be, committed 2021-02-22
- Comitter:
- lbuha
- Date:
- Mon Feb 22 01:53:52 2021 +0000
- Commit message:
- .
Changed in this revision
LM35.cpp | Show annotated file Show diff for this revision Revisions of this file |
LM35.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 0604431a65be LM35.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM35.cpp Mon Feb 22 01:53:52 2021 +0000 @@ -0,0 +1,19 @@ +#include "LM35.h" +#include "mbed.h" + +LM35::LM35(PinName pin) : _pin(pin) {} + +float temperatura; + +float LM35::mjerenje() +{ + + Serial pc(USBTX, USBRX); + temperatura = _pin.read(); + temperatura = (temperatura)*500; + + pc.printf("Temperatura je %f stupnjeva Celzijevih.\n \n \r", temperatura); //ispis temperature na računalo + + return temperatura; + +} \ No newline at end of file
diff -r 000000000000 -r 0604431a65be LM35.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM35.h Mon Feb 22 01:53:52 2021 +0000 @@ -0,0 +1,15 @@ +#ifndef MBED_LM35 +#define MBED_LM35 +#include "mbed.h" +class LM35 +{ +public: + LM35(PinName pin); + float mjerenje(); + +private: + AnalogIn _pin; + +}; + +#endif \ No newline at end of file