AWind
FakeSensor.h
1 #pragma once
2 /*
3  AWind.h - Arduino window library support for Color TFT LCD Boards
4  Copyright (C)2014 Andrei Degtiarev. All right reserved
5 
6  You can find the latest version of the library at
7  https://github.com/AndreiDegtiarev/AWind
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the CC BY-NC-SA 3.0 license.
11  Please see the included documents for further information.
12 
13  Commercial use of this library requires you to buy a license that
14  will allow commercial use. This includes using the library,
15  modified or not, as a tool to sell products.
16 
17  The license applies to all part of the library including the
18  examples and tools supplied with the library.
19 */
20 #include "ISensor.h"
22 class FakeSensor : public ISensor
23 {
24  float _value;
25 public:
26  FakeSensor()
27  {
28  _value=50;
29  }
31  const __FlashStringHelper* Name()
32  {
33  return F("Sensor");
34  }
36  int Precission()
37  {
38  return 0;
39  }
42  {
43  return -100;
44  }
47  {
48  return 200;
49  }
51 
55  bool Measure(float &data)
56  {
57  data=_value;
58  return true;
59  }
61  void Increase()
62  {
63  _value++;
64  }
66  void Decrease()
67  {
68  _value--;
69  }
70 };
bool Measure(float &data)
Perfrom measurements.
Definition: FakeSensor.h:55
void Decrease()
Decreases internal value.
Definition: FakeSensor.h:66
float HighMeasurementLimit()
Return highest possible measurement limit. If value outside of this limit, measurements threatet as e...
Definition: FakeSensor.h:46
float LowMeasurementLimit()
Return lowest possible measurement limit. If value outside of this limit, measurements threatet as er...
Definition: FakeSensor.h:41
void Increase()
Increases internal value.
Definition: FakeSensor.h:61
Fake sensor. It is intended only to generate some data. Sensor value can be modified via Increase...
Definition: FakeSensor.h:22
const __FlashStringHelper * Name()
Returns sensor name. Only for debug purpose.
Definition: FakeSensor.h:31
int Precission()
Return how many decimal places make sence for the sensor.
Definition: FakeSensor.h:36