You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
396 B
36 lines
396 B
#ifndef __LED_HPP__
|
|
#define __LED_HPP__
|
|
|
|
#include "./../csl/interfaces/pin.hpp"
|
|
|
|
template <typename T>
|
|
class LED
|
|
{
|
|
public:
|
|
|
|
LED(Pin<T>& pin) :
|
|
pin(pin)
|
|
{}
|
|
|
|
void turnOn()
|
|
{
|
|
pin.set(true);
|
|
}
|
|
|
|
void turnOff()
|
|
{
|
|
pin.set(false);
|
|
}
|
|
|
|
void toggle()
|
|
{
|
|
pin.toggle();
|
|
}
|
|
|
|
private:
|
|
|
|
Pin<T>& pin;
|
|
};
|
|
|
|
#endif // __LED_HPP__
|