ardupilot/libraries/AP_Relay/AP_Relay_APM1.cpp
Sandro Benigno 345e517272 New Relay class and the subclasses for APM1 and APM2.
Updated AP_Camera class.
2012-12-22 17:24:35 +09:00

37 lines
438 B
C++

#include <avr/io.h>
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "wiring.h"
#endif
#include "AP_Relay_APM1.h"
void AP_Relay_APM1::on()
{
PORTL |= B00000100;
}
void AP_Relay_APM1::off()
{
PORTL &= ~B00000100;
}
void AP_Relay_APM1::toggle()
{
PORTL ^= B00000100;
}
void AP_Relay_APM1::set(bool status)
{
if (status)
on();
else
off();
}
bool AP_Relay_APM1::get()
{
return PORTL & B00000100;
}