TVZ2020 / LM35

Fork of LM35 by Lukas Buha

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LM35.cpp Source File

LM35.cpp

00001 #include "LM35.h"
00002 #include "mbed.h"
00003 
00004 LM35::LM35(PinName pin) : _pin(pin) {}
00005     
00006 float temperatura;
00007  
00008 float LM35::mjerenje()
00009 {
00010     
00011      Serial pc(USBTX, USBRX);
00012      temperatura = _pin.read();
00013      temperatura = (temperatura)*500;
00014     
00015     pc.printf("Temperatura je %f stupnjeva Celzijevih.\n \n \r", temperatura); //ispis temperature na računalo
00016     
00017     return temperatura;
00018     
00019 }