StarBoard Orange - Example application No.1 GoogleChartLogger with StarBoard Orange
Dependencies: EthernetNetIf mbed
Sensor/SensorMCP9700.cpp
- Committer:
- shintamainjp
- Date:
- 2010-08-11
- Revision:
- 1:123eff9ba7b2
- Parent:
- 0:77d8b45a8f42
File content as of revision 1:123eff9ba7b2:
/** * Sensor interface driver. (Version 0.0.1) * * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems) * http://shinta.main.jp/ */ #include "SensorMCP9700.h" SensorMCP9700::SensorMCP9700(PinName pin) : analogInput(pin) {} SensorMCP9700::~SensorMCP9700() {} double SensorMCP9700::read() { /* * The value range of analogInput.read() is 0.0 to 1.0. */ return (((analogInput.read() * 3.3) - 0.5) * 100.0); }