RCInput.cpp 520 B

12345678910111213141516171819202122232425262728293031
  1. #include "RCInput.h"
  2. using namespace Empty;
  3. RCInput::RCInput()
  4. {}
  5. void RCInput::init()
  6. {}
  7. bool RCInput::new_input() {
  8. return false;
  9. }
  10. uint8_t RCInput::num_channels() {
  11. return 0;
  12. }
  13. uint16_t RCInput::read(uint8_t chan) {
  14. if (chan == 2) return 900; /* throttle should be low, for safety */
  15. else return 1500;
  16. }
  17. uint8_t RCInput::read(uint16_t* periods, uint8_t len) {
  18. for (uint8_t i = 0; i < len; i++){
  19. if (i == 2) periods[i] = 900;
  20. else periods[i] = 1500;
  21. }
  22. return len;
  23. }