-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main'
- Loading branch information
Showing
18 changed files
with
320 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. _Movement: | ||
|
||
Movement | ||
========= | ||
Working with NanoNav's motors. | ||
|
||
Introduction | ||
------------ | ||
|
||
To complete the Wumpus challenge, NanoBot will have to navigate the board by moving and turning. It does this by sending power to the motors, which then turn the wheels. Speed of the motors is controlled by the amount of power you send. However, because most microcontrollers can only send LOW or HIGH voltage (0V or 3.3V in the Arduino's case), power is controlled by a process called Pulse Width Modulation (PWM), which is explained in more detail `here <https://learn.sparkfun.com/tutorials/pulse-width-modulation/all>`_ if you're interested. | ||
|
||
Sensors called encoders are used to track the rotation of the motors accurately. Encoders track rotation in ticks. You can read more `here <https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/>`_ if you're interested, but all you have to know is that a positive change in ticks corresponds to a forward rotation of the motor, and a negative change to a backward rotation of the motor. | ||
|
||
You don't have to use encoders in your solution, though they do provide greater accuracy. | ||
|
||
|
||
Quick Example | ||
------------- | ||
|
||
.. code-block:: python | ||
|
||
from nanonav import NanoBot | ||
import time | ||
|
||
# Create a NanoBot object | ||
robot = NanoBot() | ||
|
||
# Move forward for 2 seconds | ||
robot.m1_forward(30) | ||
robot.m2_forward(30) | ||
time.sleep(2) | ||
|
||
# Stop | ||
robot.stop() | ||
robot.sleep(2) | ||
|
||
# Move backward for 2 seconds | ||
robot.m1_backward(30) | ||
robot.m2_backward(30) | ||
time.sleep(2) | ||
|
||
# Stop | ||
robot.stop() | ||
|
||
Usage | ||
----- | ||
|
||
.. autoclass:: nanonav.NanoBot | ||
:members: | ||
:exclude-members: ir_left, ir_right | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.