COSA
An Object-Oriented Platform for Arduino Programming
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
TCS230.hh
Go to the documentation of this file.
1
21
#ifndef COSA_TCS320_HH
22
#define COSA_TCS320_HH
23
24
#include "
Cosa/OutputPin.hh
"
25
#include "
Cosa/ExternalInterrupt.hh
"
26
46
class
TCS230
{
47
public
:
52
enum
Filter
{
53
RED_FILTER
= 0,
54
BLUE_FILTER
= 1,
55
NO_FILTER
= 2,
56
GREEN_FILTER
= 3
57
};
58
69
#if !defined(BOARD_ATTINY)
70
TCS230
(
Board::ExternalInterruptPin
out =
Board::EXT1
,
71
Board::DigitalPin
s0 =
Board::D4
,
72
Board::DigitalPin
s1 =
Board::D5
,
73
Board::DigitalPin
s2 =
Board::D6
,
74
Board::DigitalPin
s3 =
Board::D7
);
75
#else
76
TCS230
(
Board::ExternalInterruptPin
out =
Board::EXT0
,
77
Board::DigitalPin
s0 =
Board::D0
,
78
Board::DigitalPin
s1 =
Board::D1
,
79
Board::DigitalPin
s2 =
Board::D2
,
80
Board::DigitalPin
s3 =
Board::D3
);
81
#endif
82
88
void
frequency_scaling
(uint8_t percent);
89
94
void
photodiode
(
Filter
type);
95
102
uint16_t
sample
(uint8_t ms = 10);
103
104
private
:
105
class
IRQPin :
public
ExternalInterrupt
{
106
public
:
107
static
const
uint16_t MAX = 10000;
108
IRQPin(
Board::ExternalInterruptPin
pin);
109
virtual
void
on_interrupt(uint16_t arg = 0);
110
friend
class
TCS230
;
111
private
:
112
uint16_t m_count;
113
};
114
IRQPin m_out;
115
OutputPin
m_s0;
116
OutputPin
m_s1;
117
OutputPin
m_s2;
118
OutputPin
m_s3;
119
};
120
121
#endif
122
123
Board::DigitalPin
DigitalPin
Definition:
ATmega1284P.hh:106
ExternalInterrupt
Definition:
ExternalInterrupt.hh:33
Board::D5
Definition:
ATmega1284P.hh:112
TCS230::sample
uint16_t sample(uint8_t ms=10)
Definition:
TCS230.cpp:73
TCS230::NO_FILTER
Definition:
TCS230.hh:55
Board::D3
Definition:
ATmega1284P.hh:110
Board::D6
Definition:
ATmega1284P.hh:113
TCS230::GREEN_FILTER
Definition:
TCS230.hh:56
TCS230
Definition:
TCS230.hh:46
TCS230::BLUE_FILTER
Definition:
TCS230.hh:54
ExternalInterrupt.hh
OutputPin.hh
Board::EXT1
Definition:
ATmega1284P.hh:192
Board::D2
Definition:
ATmega1284P.hh:109
Board::ExternalInterruptPin
ExternalInterruptPin
Definition:
ATmega1284P.hh:190
TCS230::photodiode
void photodiode(Filter type)
Definition:
TCS230.cpp:38
TCS230::RED_FILTER
Definition:
TCS230.hh:53
OutputPin
Definition:
OutputPin.hh:29
TCS230::frequency_scaling
void frequency_scaling(uint8_t percent)
Definition:
TCS230.cpp:45
Board::D0
Definition:
ATmega1284P.hh:107
TCS230::Filter
Filter
Definition:
TCS230.hh:52
Board::D4
Definition:
ATmega1284P.hh:111
Board::D1
Definition:
ATmega1284P.hh:108
TCS230::TCS230
TCS230(Board::ExternalInterruptPin out=Board::EXT1, Board::DigitalPin s0=Board::D4, Board::DigitalPin s1=Board::D5, Board::DigitalPin s2=Board::D6, Board::DigitalPin s3=Board::D7)
Definition:
TCS230.cpp:24
Board::D7
Definition:
ATmega1284P.hh:114
Board::EXT0
Definition:
ATmega1284P.hh:191
libraries
TCS230
TCS230.hh
Generated on Thu Aug 31 2017 17:02:04 for COSA by
1.8.11