mirror of
https://github.com/eclipse/upm.git
synced 2025-07-04 10:51:12 +03:00
Added initial interfaces and some sensors implementing them
This commit is contained in:

committed by
Serban Waltter

parent
85608a9f61
commit
e7820f2831
@ -24,6 +24,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mraa/gpio.h>
|
||||
#include <interfaces/iCollision.hpp>
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
@ -42,15 +43,15 @@ namespace upm {
|
||||
* @con gpio
|
||||
*
|
||||
* @brief API for the Collision Sensor
|
||||
*
|
||||
*
|
||||
* The Collision Sensor can detect whether any
|
||||
* collision movement or vibration happens.
|
||||
* It outputs a low pulse signal when vibration is detected.
|
||||
* It outputs a low pulse signal when vibration is detected.
|
||||
*
|
||||
* @image html collision.jpg
|
||||
* @snippet collision.cxx Interesting
|
||||
*/
|
||||
class Collision {
|
||||
class Collision : virtual public iCollision {
|
||||
public:
|
||||
/**
|
||||
* Collision sensor constructor
|
||||
@ -63,11 +64,11 @@ namespace upm {
|
||||
*/
|
||||
~Collision();
|
||||
/**
|
||||
* @return bool Defines whether something is colliding with sensor
|
||||
* @return boolean value defining whether something is colliding with sensor
|
||||
*/
|
||||
bool isColliding();
|
||||
virtual bool isColliding();
|
||||
|
||||
private:
|
||||
mraa_gpio_context m_gpio;
|
||||
};
|
||||
mraa_gpio_context m_gpio;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user