encoder
¶
Encoder utility.
Classes:
| Name | Description |
|---|---|
Encoder |
Convert encoder value to integer. |
Functions:
| Name | Description |
|---|---|
test_encoder |
Test for the encoder class. |
Encoder
¶
Convert encoder value to integer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
track_1
|
int
|
The pin the track_1 of the encoder is connected to. |
required |
track_2
|
int
|
The pin the track_2 of the encoder is connected to. |
required |
Methods:
| Name | Description |
|---|---|
get_rotate |
Get the rotary encoder value. |
reset_rotate |
Reset rotary encoder value. |
rotate_changed |
Indicate if the encoder value changed since last call to this method. |
Source code in src/aalec/encoder.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
get_rotate
¶
get_rotate() -> int
Get the rotary encoder value.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Value of the rotary encoder. |
Source code in src/aalec/encoder.py
56 57 58 59 60 61 62 | |
reset_rotate
¶
reset_rotate(value: int) -> None
Reset rotary encoder value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
new value for the rotary encoder. |
required |
Source code in src/aalec/encoder.py
76 77 78 79 80 81 82 83 | |
rotate_changed
¶
rotate_changed() -> bool
Indicate if the encoder value changed since last call to this method.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the value changed since last call. False otherwise. |
Source code in src/aalec/encoder.py
64 65 66 67 68 69 70 71 72 73 74 | |
test_encoder
¶
test_encoder() -> None
Test for the encoder class.
Source code in src/aalec/encoder.py
86 87 88 89 90 91 92 93 94 95 96 | |