-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings_example.py
57 lines (43 loc) · 1.36 KB
/
settings_example.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
#!/usr/bin/env python
from math import pi
import logging
import datetime
import logging.config
# Constants for robot
# Diameter of wheels in mm
wheelDiameter = 100
# Encoder values for one full revolution of the wheel
oneRevolution = 360
# Space between wheels
wheelsSpacing = 25.9
# Robot types:
# main or secondary
robotSettings = {
'robotType': 'main',
'oneEncMM': 2 * pi * (wheelDiameter / 2) / oneRevolution / 10,
'circumferenceOfCircle': 2 * pi * (wheelsSpacing / 2),
'sensorThreshold': 30,
'encoderMaxValue': 4244897280,
'motorsPin': 29,
'valvePin': 31,
'servoPipeChannel': 0,
'servoBeeChannel': 2,
'sideSwitchPin': 35,
'startSwitchPin': 37,
}
debugMode = True
# Logger settings
logging.root.handlers = []
FORMAT = '%(asctime)s : %(levelname)s : %(message)s\r'
logging.basicConfig(format=FORMAT, level=logging.DEBUG,
filename='../logs.log'
)
# set up logging to console
console = logging.StreamHandler()
console.setLevel(logging.DEBUG) # this is only if we want to error logs be printed out to console
# set a format which is simpler for console use
formatter = logging.Formatter('%(asctime)s : %(levelname)s : %(message)s\r')
console.setFormatter(formatter)
logging.getLogger("").addHandler(console)
logger = logging.getLogger('Adafruit_I2C.Device')
logger.setLevel(logging.CRITICAL)