![](/media/cache/profiles/8e5e15c4e6d09c8333a17843461041a9.jpg.50x50_q85.jpg)
Web server based weather station using Sparkfun Weather Meters.
Dependencies: FatFileSystem mbed WeatherMeters SDFileSystem
Anemometer.h@0:616601bde9fb, 2012-02-23 (annotated)
- Committer:
- AdamGreen
- Date:
- Thu Feb 23 21:38:39 2012 +0000
- Revision:
- 0:616601bde9fb
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AdamGreen | 0:616601bde9fb | 1 | /* Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/) |
AdamGreen | 0:616601bde9fb | 2 | |
AdamGreen | 0:616601bde9fb | 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
AdamGreen | 0:616601bde9fb | 4 | you may not use this file except in compliance with the License. |
AdamGreen | 0:616601bde9fb | 5 | You may obtain a copy of the License at |
AdamGreen | 0:616601bde9fb | 6 | |
AdamGreen | 0:616601bde9fb | 7 | http://www.apache.org/licenses/LICENSE-2.0 |
AdamGreen | 0:616601bde9fb | 8 | |
AdamGreen | 0:616601bde9fb | 9 | Unless required by applicable law or agreed to in writing, software |
AdamGreen | 0:616601bde9fb | 10 | distributed under the License is distributed on an "AS IS" BASIS, |
AdamGreen | 0:616601bde9fb | 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
AdamGreen | 0:616601bde9fb | 12 | See the License for the specific language governing permissions and |
AdamGreen | 0:616601bde9fb | 13 | limitations under the License. |
AdamGreen | 0:616601bde9fb | 14 | */ |
AdamGreen | 0:616601bde9fb | 15 | /* Header file for class to interface with anemometer sensor of Sparkfun Weather Meters: |
AdamGreen | 0:616601bde9fb | 16 | http://www.sparkfun.com/products/8942 |
AdamGreen | 0:616601bde9fb | 17 | */ |
AdamGreen | 0:616601bde9fb | 18 | #ifndef _ANEMOMETER_H_ |
AdamGreen | 0:616601bde9fb | 19 | #define _ANEMOMETER_H_ |
AdamGreen | 0:616601bde9fb | 20 | |
AdamGreen | 0:616601bde9fb | 21 | #include "DebouncedFallingEdgeCounter.h" |
AdamGreen | 0:616601bde9fb | 22 | |
AdamGreen | 0:616601bde9fb | 23 | |
AdamGreen | 0:616601bde9fb | 24 | namespace AFP |
AdamGreen | 0:616601bde9fb | 25 | { |
AdamGreen | 0:616601bde9fb | 26 | |
AdamGreen | 0:616601bde9fb | 27 | class CAnemometer : protected CDebouncedFallingEdgeCounter |
AdamGreen | 0:616601bde9fb | 28 | { |
AdamGreen | 0:616601bde9fb | 29 | protected: |
AdamGreen | 0:616601bde9fb | 30 | Ticker m_OneSecondTicker; |
AdamGreen | 0:616601bde9fb | 31 | float m_CurrentWindSpeed; |
AdamGreen | 0:616601bde9fb | 32 | float m_MaximumWindSpeed; |
AdamGreen | 0:616601bde9fb | 33 | |
AdamGreen | 0:616601bde9fb | 34 | public: |
AdamGreen | 0:616601bde9fb | 35 | CAnemometer(PinName AnemometerPin, unsigned int IgnoreTimeForDebounceInMicroSeconds = 1000); |
AdamGreen | 0:616601bde9fb | 36 | |
AdamGreen | 0:616601bde9fb | 37 | float GetCurrentWindSpeed(); |
AdamGreen | 0:616601bde9fb | 38 | float GetMaximumWindSpeed(); |
AdamGreen | 0:616601bde9fb | 39 | void ResetMaximumWindSpeed(); |
AdamGreen | 0:616601bde9fb | 40 | |
AdamGreen | 0:616601bde9fb | 41 | protected: |
AdamGreen | 0:616601bde9fb | 42 | void OneSecondTickerISR(); |
AdamGreen | 0:616601bde9fb | 43 | }; |
AdamGreen | 0:616601bde9fb | 44 | |
AdamGreen | 0:616601bde9fb | 45 | } // namespace AFP |
AdamGreen | 0:616601bde9fb | 46 | using namespace AFP; |
AdamGreen | 0:616601bde9fb | 47 | |
AdamGreen | 0:616601bde9fb | 48 | #endif // _ANEMOMETER_H_ |