2012-12-17 15:54:55 -04:00
|
|
|
|
|
|
|
#include "RCInput.h"
|
|
|
|
|
|
|
|
using namespace Empty;
|
2015-12-07 14:53:55 -04:00
|
|
|
RCInput::RCInput()
|
2012-12-17 15:54:55 -04:00
|
|
|
{}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
void RCInput::init()
|
2012-12-17 15:54:55 -04:00
|
|
|
{}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
bool RCInput::new_input() {
|
2014-03-25 00:39:41 -03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t RCInput::num_channels() {
|
2012-12-17 15:54:55 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-05-02 09:55:28 -03:00
|
|
|
uint16_t RCInput::read(uint8_t chan) {
|
|
|
|
if (chan == 2) return 900; /* throttle should be low, for safety */
|
2012-12-17 15:54:55 -04:00
|
|
|
else return 1500;
|
|
|
|
}
|
|
|
|
|
2015-12-07 14:53:55 -04:00
|
|
|
uint8_t RCInput::read(uint16_t* periods, uint8_t len) {
|
2012-12-17 15:54:55 -04:00
|
|
|
for (uint8_t i = 0; i < len; i++){
|
2013-01-03 06:14:00 -04:00
|
|
|
if (i == 2) periods[i] = 900;
|
2012-12-17 15:54:55 -04:00
|
|
|
else periods[i] = 1500;
|
|
|
|
}
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|