StarBoard Orange - Example application No.1 GoogleChartLogger with StarBoard Orange

Dependencies:   EthernetNetIf mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SensorMCP9700.cpp Source File

SensorMCP9700.cpp

00001 /**
00002  * Sensor interface driver. (Version 0.0.1)
00003  *
00004  * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
00005  * http://shinta.main.jp/
00006  */
00007 
00008 #include "SensorMCP9700.h"
00009 
00010 SensorMCP9700::SensorMCP9700(PinName pin) : analogInput(pin) {}
00011 SensorMCP9700::~SensorMCP9700() {}
00012 double SensorMCP9700::read() {
00013     /*
00014      * The value range of analogInput.read() is 0.0 to 1.0.
00015      */
00016     return (((analogInput.read() * 3.3) - 0.5) * 100.0);
00017 }