mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 15:15:07 +03:00 
			
		
		
		
	Added iElectromagnet interface
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
		 Stefan Andritoiu
					Stefan Andritoiu
				
			
				
					committed by
					
						 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
			
				
	
			
			
			 Mihai Tudor Panu
						Mihai Tudor Panu
					
				
			
						parent
						
							b058d341c0
						
					
				
				
					commit
					b917f0ca54
				
			| @@ -24,6 +24,7 @@ | ||||
| #pragma once | ||||
|  | ||||
| #include <mraa/gpio.h> | ||||
| #include <interfaces/iElectromagnet.hpp> | ||||
|  | ||||
| #define HIGH      1 | ||||
| #define LOW       0 | ||||
| @@ -44,13 +45,13 @@ namespace upm { | ||||
|    * @con gpio | ||||
|    * | ||||
|    * @brief API for the  Electromagnet | ||||
|    *  | ||||
|    * | ||||
|    * The  Electromagnet can hold up to 1 kg (approximately 2.2 lbs) | ||||
|    * | ||||
|    * @image html electromagnet.jpg | ||||
|    * @snippet electromagnet.cxx Interesting | ||||
|    */ | ||||
|   class Electromagnet { | ||||
|   class Electromagnet : virtual public iElectromagnet { | ||||
|   public: | ||||
|     /** | ||||
|      *  Electromagnet constructor | ||||
| @@ -65,11 +66,11 @@ namespace upm { | ||||
|     /** | ||||
|      * Turns the magnet on | ||||
|      */ | ||||
|      void on(); | ||||
|      virtual void on(); | ||||
|     /** | ||||
|      * Turns the magnet off | ||||
|      */ | ||||
|      void off(); | ||||
|      virtual void off(); | ||||
|  | ||||
|   private: | ||||
|         mraa_gpio_context m_gpio; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user