mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-30 22:54:44 +03:00 
			
		
		
		
	ecs1030: move example and fix doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
		| @@ -28,7 +28,7 @@ add_executable (nrf8001-broadcast-example nrf8001_broadcast.cxx) | |||||||
| add_executable (nrf8001-helloworld-example nrf8001_helloworld.cxx) | add_executable (nrf8001-helloworld-example nrf8001_helloworld.cxx) | ||||||
| add_executable (lpd8806-example lpd8806-example.cxx) | add_executable (lpd8806-example lpd8806-example.cxx) | ||||||
| add_executable (mlx90614-example mlx90614-example.cxx) | add_executable (mlx90614-example mlx90614-example.cxx) | ||||||
| add_executable (ecs1030-example ecs1030-example.cxx) | add_executable (ecs1030-example ecs1030.cxx) | ||||||
| add_executable (mq2-example mq2-example.cxx) | add_executable (mq2-example mq2-example.cxx) | ||||||
| add_executable (mq3-example mq3-example.cxx) | add_executable (mq3-example mq3-example.cxx) | ||||||
| add_executable (mq5-example mq5-example.cxx) | add_executable (mq5-example mq5-example.cxx) | ||||||
|   | |||||||
| @@ -28,6 +28,8 @@ | |||||||
| #include <mraa/aio.h> | #include <mraa/aio.h> | ||||||
| #include <mraa/gpio.h> | #include <mraa/gpio.h> | ||||||
|  |  | ||||||
|  | namespace upm { | ||||||
|  |  | ||||||
| #define NUMBER_OF_SAMPLES  500 | #define NUMBER_OF_SAMPLES  500 | ||||||
| #define ADC_RESOLUTION     1024 | #define ADC_RESOLUTION     1024 | ||||||
| #define SUPPLYVOLTAGE      5100 | #define SUPPLYVOLTAGE      5100 | ||||||
| @@ -39,7 +41,12 @@ | |||||||
| #define TRUE               HIGH | #define TRUE               HIGH | ||||||
| #define FALSE              LOW | #define FALSE              LOW | ||||||
|  |  | ||||||
| namespace upm { | /** | ||||||
|  |  * @brief C++ API for ECS1030 (electricity sensor) | ||||||
|  |  * | ||||||
|  |  * @snippet ecs1030.cxx Interesting | ||||||
|  |  */ | ||||||
|  |  | ||||||
| class ECS1030 { | class ECS1030 { | ||||||
|     public: |     public: | ||||||
|         static const uint8_t DELAY_MS  = 20000 / NUMBER_OF_SAMPLES; /* 1/50Hz is 20ms period */ |         static const uint8_t DELAY_MS  = 20000 / NUMBER_OF_SAMPLES; /* 1/50Hz is 20ms period */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Brendan Le Foll
					Brendan Le Foll