You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-51Lines changed: 78 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,24 @@ A MicroPython Bluetooth library for controlling LEGO hubs and creating custom Bl
14
14
15
15
## Installation
16
16
17
-
```bash
18
-
pip install btbricks
17
+
### On LMS-ESP32
18
+
19
+
The module should be included in the latest Micropython firmware from <https://wwww.antonsmindstorms.com>. If not, use ViperIDE or Thonny and create a new file called rcservo.py.
20
+
Copy the contents from the same file in this repository inside.
21
+
22
+
### On MicroPython device using `micropip` from PyPI
23
+
24
+
```python
25
+
import micropip
26
+
await micropip.install("btbricks")
19
27
```
20
28
29
+
Note: `micropip` must be available on the target board and may require an internet connection from the device.
30
+
31
+
### On SPIKE Legacy or MINDSTORMS Robot Inventor
32
+
33
+
Use the installer script in mpy-robot-tools: <https://github.com/antonvh/mpy-robot-tools/blob/master/Installer/install_mpy_robot_tools.py>
34
+
21
35
## Quick Start
22
36
23
37
### Connect to a LEGO Hub
@@ -47,67 +61,83 @@ if hub.is_connected():
47
61
```
48
62
49
63
### Create an RC Receiver (Hub-side)
50
-
RCReceiver, R_STICK_HOR, R_STICK_VER
51
-
52
-
# Create RC receiver
53
-
receiver = RCReceiver(name="robot")
54
-
55
-
# Wait for transmitter connection
56
-
while not receiver.is_connected():
57
-
pass
64
+
Use the examples in the `examples/` folder for full, runnable code. Minimal receiver/transmitter snippets:
58
65
59
-
print("Transmitter connected!")
66
+
```python
67
+
from btbricks import RCReceiver, R_STICK_HOR, R_STICK_VER
68
+
from time import sleep_ms
69
+
70
+
# Create RC receiver (advertises as "robot" by default)
@@ -134,9 +164,6 @@ See the [documentation](docs/api.rst) for detailed API reference.
134
164
-**ESP32** with MicroPython
135
165
- Other MicroPython boards with `ubluetooth` support
136
166
137
-
## Firmware Notes
138
-
139
-
SPIKE Prime requires the MINDSTORMS firmware for Bluetooth support. See [Anton's Mindstorms documentation](https://docs.antonsmindstorms.com) for detailed setup instructions.
0 commit comments