-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKiduino.h
117 lines (104 loc) · 1.97 KB
/
Kiduino.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
Kiduino.h - kiduino library
Copyright (c) 2014 Adithya Selvaprithiraj. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef Kiduino_h
#define Kiduino_h
#include "Arduino.h"
class Led
{
public:
Led(int pin);
void blink(int a);
void blink(int a,int b);
void on();
void off();
void fade();
private:
int _pin;
boolean ledstate;
long int current;
long int previous;
int brightness;
int fadeAmount;
};
class Ping
{
public:
Ping(int pin);
long int getcm();
long int getin();
private:
long int x;
long int dist;
int _pin;
};
class SLed
{
public:
SLed();
void display(int a);
private:
boolean number[10];
};
class RGB
{
public:
RGB(int pin1,int pin2,int pin3);
void write(int a,int b,int c);
void rand();
private:
int x;
int y;
int z;
int _pin1;
int _pin2;
int _pin3;
};
class SIRC
{
public:
SIRC(int pin,int mode);
int read();
void write(int value);
private:
void sendCode(int number);
int _pin;
int val;
boolean data[12];
};
class PIN
{
public:
PIN(int pin,int mode);
void on();
void off();
void awrite(int a);
int aread();
private:
int _pin;
int analog;
};
class GP120
{
public:
GP120(int pin);
int read();
private:
int _pin;
int val;
int volts;
int range;
};
#endif