Skip to content

Commit

Permalink
python: RCInput: add Navio+ support
Browse files Browse the repository at this point in the history
Add check channel number
Add Navio+ entry and auto choice shield
  • Loading branch information
Igor Anokhin committed Dec 21, 2017
1 parent e3a80ff commit 361cc0e
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions Python/RCInput.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import sys, time
import time

import navio.rcinput
import navio.util
import navio.Common.util

navio.util.check_apm()
import navio.Navio2.RCInput
import navio.Navio.RCInput

rcin = navio.rcinput.RCInput()
READ_ERROR = -1

def get_rcin():
if navio.Common.util.get_navio_version() == "NAVIO2":

return navio.Navio2.RCInput()
else:
return navio.Navio.RCInput()


navio.Common.util.check_apm()

rcin = get_rcin()
while (True):
period = rcin.read(2)
print period
time.sleep(1)
if (period != READ_ERROR):
print period
time.sleep(1)
else:
exit(READ_ERROR)

0 comments on commit 361cc0e

Please sign in to comment.