hi
im looking for some simple solution for my output class led.
momentary, im buildung my own litte library for simple avr applications
for beginner.
first class will be used to set up an led object like this:
1 | #ifndef CLED_H_
|
2 | #define CLED_H_
|
3 |
|
4 |
|
5 | class CLED
|
6 | {
|
7 | short pL, pN;
|
8 | public:
|
9 | //constructor
|
10 | LED(){
|
11 | }
|
12 | //methods
|
13 | void ini(){
|
14 | // ...
|
15 | }
|
16 | void toggle(){
|
17 | // do something
|
18 | }
|
19 | void turnOn(){
|
20 | // do something
|
21 | }
|
22 | void turnOff(){
|
23 | // do something
|
24 | }
|
25 | }; //CLED
|
26 |
|
27 |
|
28 | #endif /* CLED_H_ */
|
main.cpp
im looking for a solution, for the constructor or an ini method,
whatever works.
when you generate the object, you add some paramaters (eq.: B 3 (PortB
Pin3)) and then, when i finally control the object, it knows itself,
where to rout the signal.
eg:
generate the object:
CLED ledRed("B", 3);
control it:
ledRed.toggle();