Skip to content

Commit 014fc2d

Browse files
committed
Added description to inventor_box example
1 parent 249691c commit 014fc2d

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

micropython/examples/inventor/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
- [Audio Examples](#audio-examples)
3232
- [Tone Song](#tone-song)
3333
- [Motor Song](#motor-song)
34+
- [Showcase Examples](#showcase-examples)
35+
- [Inventor Bot](#inventor-bot)
3436

3537
## Function Examples
3638

@@ -194,4 +196,12 @@ This example shows you how you can use Inventor 2040/2350 W's audio output with
194196
### Motor Song
195197
[audio/motor_song.py](audio/motor_song.py)
196198

197-
A fun example of how to change a motor's frequency to have it play a song.
199+
A fun example of how to change a motor's frequency to have it play a song.
200+
201+
202+
## Showcase Examples
203+
204+
### Inventor Bot
205+
[showcase/inventor_bot.py]([showcase/inventor_bot.py)
206+
207+
A 2-wheeled remote-controlled robot with gripper, powered by Inventor 2040/2350 W.

micropython/examples/inventor/showcase/inventor_bot.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,28 @@
66

77

88
"""
9-
A demonstration of driving both of Inventor 2040 W's motor outputs through a
10-
sequence of velocities, with the help of their attached encoders and PID control.
9+
A 2-wheeled remote-controlled robot with gripper, powered by Inventor 2040/2350 W.
10+
11+
Remote control is achieved by an IR receiver is connected to GPIO0.
12+
Signals detected by the receiver are processed by the AyeArr library
13+
and passed to callback functions for various robot actions. These are
14+
* Drive forward / backward
15+
* Turn left / right
16+
* Gripper open / close
17+
* Set onboard LED colours
18+
19+
The gripper is driven by a servo connected to the SERVO_1 header.
1120
1221
Press "User" to exit the program.
1322
"""
1423

1524
# Wheel friendly names
1625
LEFT = MOTOR_A
1726
RIGHT = MOTOR_B
18-
NAMES = ["LEFT", "RIGHT"]
1927

2028
# Constants
2129
UPDATES = 100 # How many times to update the motor per second
2230
UPDATE_RATE = 1 / UPDATES
23-
PRINT_DIVIDER = 4 # How many of the updates should be printed (i.e. 2 would be every other update)
2431

2532
# Motor Constnats
2633
GEAR_RATIO = 50 # The gear ratio of the motors

0 commit comments

Comments
 (0)