33 lines
472 B
C++
33 lines
472 B
C++
/*
|
|
* Start.hpp
|
|
*
|
|
* Created: 08.05.2014 17:55:29
|
|
* Author: netz
|
|
*/
|
|
|
|
|
|
#ifndef START_H_
|
|
#define START_H_
|
|
|
|
|
|
#include "hardware/pin.hpp"
|
|
|
|
template <typename Port, int start_pin>
|
|
class Start {
|
|
public:
|
|
Start() {
|
|
init();
|
|
}
|
|
uint8_t is_pressed() {
|
|
return (!start_in::read());
|
|
}
|
|
private:
|
|
void init() {
|
|
start_in::make_input();
|
|
start_in::pullup();
|
|
}
|
|
const typedef avrlib::pin<Port, start_pin> start_in;
|
|
};
|
|
|
|
|
|
#endif /* START_H_ */ |