COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
Touch.hh
Go to the documentation of this file.
1
21
#ifndef COSA_TOUCH_HH
22
#define COSA_TOUCH_HH
23
24
#include "
Cosa/Types.h
"
25
#include "
Cosa/IOPin.hh
"
26
#include "
Cosa/Periodic.hh
"
27
43
class
Touch
:
private
IOPin
,
public
Periodic
{
44
public
:
51
Touch
(
Job::Scheduler
* scheduler,
Board::DigitalPin
pin
, uint16_t threshold = 250);
52
57
virtual
void
on_touch
() = 0;
58
59
protected
:
61
static
const
uint16_t
SAMPLE_RATE
= 16;
62
64
const
uint16_t
THRESHOLD
;
65
67
uint32_t
m_start
;
68
70
uint8_t
m_sampling
;
71
73
uint8_t
m_touched
;
74
80
virtual
void
run
();
81
};
82
83
#endif
Board::DigitalPin
DigitalPin
Definition:
ATmega1284P.hh:106
Touch::m_touched
uint8_t m_touched
Definition:
Touch.hh:73
Types.h
Pin::pin
uint8_t pin() const
Definition:
Pin.hh:103
Periodic.hh
Job::Scheduler
Definition:
Job.hh:43
Periodic
Definition:
Periodic.hh:38
Touch::Touch
Touch(Job::Scheduler *scheduler, Board::DigitalPin pin, uint16_t threshold=250)
Definition:
Touch.cpp:24
Touch::m_start
uint32_t m_start
Definition:
Touch.hh:67
Touch::on_touch
virtual void on_touch()=0
Touch::SAMPLE_RATE
static const uint16_t SAMPLE_RATE
Definition:
Touch.hh:61
Touch::run
virtual void run()
Definition:
Touch.cpp:36
IOPin
Definition:
IOPin.hh:29
IOPin.hh
Touch::THRESHOLD
const uint16_t THRESHOLD
Definition:
Touch.hh:64
Touch
Definition:
Touch.hh:43
Touch::m_sampling
uint8_t m_sampling
Definition:
Touch.hh:70
libraries
Touch
Touch.hh
Generated on Thu Aug 31 2017 17:02:04 for COSA by
1.8.11