Antonia Baumgartner / Mbed 2 deprecated Versuch21

Dependencies:   mbed

Fork of Versuch20 by Alexander Wyss

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IRSensorG.cpp Source File

IRSensorG.cpp

00001 #include <cmath>
00002 #include "IRSensorG.h"
00003 
00004 //------------------------------------------------------------------------------
00005 
00006 using namespace std;
00007 
00008 IRSensorG::IRSensorG(AnalogIn& distance):
00009 
00010     distance(distance)
00011 {
00012 
00013 
00014 }
00015 
00016 IRSensorG::~IRSensorG() {}
00017 
00018 //------------------------------------------------------------------------------
00019 
00020 int IRSensorG::read()
00021 {
00022 
00023 
00024     int d = 11/(distance)*exp(1.1534);
00025 
00026     return d;
00027 
00028 }