-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrccfg.py
74 lines (54 loc) · 2.18 KB
/
rccfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: RC-Pi Remote Control
# Purpose: Configurationg of models with Pi-Receiver
#
#
# Author: Bernd Hinze
#
# Created: 30.01.2020
# Copyright: (c) Bernd Hinze 2020
# Licence: MIT see https://opensource.org/licenses/MIT
# ----------------------------------------------------------------------------
ADS = False # configure either the ADS1115 Board is available or not
AVAL = 0.0 # default value for analog input
SIM = False # running for test and integration on a PC
# PCA9685 Parameter
FREQ = 50.0
port_tx = 6000
port_rx = 6100
if not SIM:
ifname = "wlan0"
else:
ifname = "wlp2s0"
SERVO, DIO, L298 = range(3)
'''
Parameter for channel configuration
(MODE, CHANNEL, CENTER, RATE, REVERSE, ACCFILT, FAILSAFE, STEPW)
MODE = SERVO, DIO or L298
CHANNEL = 0..15
CENTER = center position of servo in ms
RATE = max. diviation from center in ms
REVERSE = boolean reverse orientation
ACCFILT = boolean, using a filter or not to degrease the rising rate of values
FAILSAFE = 0..254
STEPW = max. steps af rate within of cycle rate of 20 ms used by the filter
'''
models = {
'TESTBED' : [(SERVO, 0, 1.5, 0.5, False, True, 127, 10),
(SERVO, 3, 1.5, 0.3, False, False, 127, 127),
(DIO, 2, 1.5, 0.5, False, False, 0, 127)],
'MyCar' : [(SERVO, 0, 1.5, 0.5, True, True, 127, 10),
(SERVO, 3, 1.5, 0.2, False, False, 127, 127)],
'MyBoat' : [(SERVO, 0, 1.5, 0.5, False, True, 127, 10),
(SERVO, 3, 1.5, 0.45, True, False, 127, 127)],
'CASPARCAR': [(L298, 0, 1.5, 0.5, False, False, 127, 127),
(SERVO,3, 1.5, 0.25, True, False, 127, 127),
(DIO, 1, 1.5, 0.5, True, False, 0, 127),
(DIO, 2, 1.5, 0.5, True, False, 254, 127)] }
MODEL = 'MyBoat'
def main():
pass
if __name__ == '__main__':
main()