33 lines
446 B
C++
33 lines
446 B
C++
/*
|
|
* Led.h
|
|
*
|
|
* Created: 03.11.2013 17:11:58
|
|
* Author: BlubbFish
|
|
*/
|
|
|
|
#ifndef LED_H_
|
|
#define LED_H_
|
|
|
|
#include "hardware/pin.hpp"
|
|
|
|
template <typename Port, int pin>
|
|
class Led {
|
|
public:
|
|
Led() {
|
|
init();
|
|
}
|
|
void on() {
|
|
led::set();
|
|
}
|
|
void off() {
|
|
led::clear();
|
|
}
|
|
private:
|
|
void init() {
|
|
led::make_output();
|
|
off();
|
|
}
|
|
const typedef avrlib::pin<Port, pin> led;
|
|
};
|
|
|
|
#endif /* LED_H_ */ |