-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7d25468
Showing
83 changed files
with
212,852 additions
and
0 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,11 @@ | ||
venv | ||
.vscode | ||
.DS_Store | ||
*~ | ||
__pycache__ | ||
|
||
#sphinx build folder | ||
docs/build | ||
|
||
#ignore gcode files | ||
*.gcode |
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,66 @@ | ||
TurtlePlotBot | ||
============= | ||
|
||
The TurtlePlotBot is a MicroPython based 3D printed drawing robot inspired | ||
by `MakersBox's <https://www.thingiverse.com/MakersBox>`_ `Arduino Chassis | ||
for Drawing Robot <https://www.thingiverse.com/thing:1091401>`_. The | ||
TurtlePlotBot can be easily built in a couple of hours and offers a fun | ||
environment to learn python programming and robotics. | ||
|
||
| | ||
.. figure:: images/hello.jpg | ||
:width: 400px | ||
:align: center | ||
|
||
Say "Hello!" to my little friend! | ||
|
||
| | ||
The software that runs the TurtlePlotBot is modular and includes the | ||
`turtleplot` module. The `turtleplot` module contains the methods needed to | ||
turn turtle graphics commands into simple robot movements. You can use the | ||
`turtleplot` module run your own robot using different hardware without | ||
having to write all the python code for each of the turtle graphics commands. | ||
|
||
A TurtlePlotBot is built from 3D printed parts, a pair of 28BYJ-48 | ||
stepper motors and uses a MG90S mini servo to lift and lower a pen used for | ||
drawing. | ||
|
||
An ESP-32 Based Microcontroller module with a 240x135 LCD display | ||
running MicroPython is paired with a `ESP32 DrawBot Board | ||
<https://penfold.owt.com/turtleplotbot3/assembly-part2.html#drawbot-board>`_ | ||
to provide the interface circuitry needed to run the stepper motors, servo, | ||
MicroSD card and a five way joystick. The TurtlePlotBot has Wifi capability | ||
allowing it to be controlled and programmed wirelessly from a computer, | ||
smartphone or tablet. | ||
|
||
A menu system provides an easy way to configure the TurtlePlotBot, connect to | ||
or create a Wifi access point as well as running TurtlePlotBot MicroPython | ||
programs without the use of a computer or another device. | ||
|
||
|
||
* Connect to a Wifi Access Point | ||
|
||
=================================== =================================== | ||
.. image:: images/main_menu-1-1.jpg .. image:: images/main_menu-1-5.jpg | ||
=================================== =================================== | ||
|
||
* Create a Wifi Access Point | ||
|
||
=================================== =================================== | ||
.. image:: images/main_menu-3-1.jpg .. image:: images/main_menu-3-3.jpg | ||
=================================== =================================== | ||
|
||
* Write a message using a font | ||
|
||
=================================== =================================== | ||
.. image:: images/message-2.jpg .. image:: images/message-10.jpg | ||
=================================== =================================== | ||
|
||
|
||
TurtlePlotBot Documentation | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
See the `TurtlePlotBot Documentation <https://penfold.owt.com/turtleplotbot3>`_ | ||
for more details. |
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,20 @@ | ||
# This file is executed on every boot (including wake-boot from deepsleep) | ||
""" | ||
boot.py | ||
""" | ||
import gc | ||
import sys | ||
|
||
sys.path.append('/programs') | ||
|
||
# uncomment to enable webrepl | ||
#import webrepl | ||
#webrepl.start() | ||
|
||
def reload(mod): | ||
mod_name = mod.__name__ | ||
del sys.modules[mod_name] | ||
gc.collect() | ||
return __import__(mod_name) | ||
|
||
|
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,15 @@ | ||
''' | ||
Better way to draw a box | ||
''' | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
bot.pendown() | ||
|
||
for _ in range(4): | ||
bot.forward(30) | ||
bot.left(90) | ||
|
||
bot.done() | ||
|
||
__import__("menu") # optional return to turtleplotbot menu |
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,23 @@ | ||
''' | ||
Even better way to draw boxes | ||
''' | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
|
||
def box(bot, size): | ||
bot.pendown() | ||
|
||
for _ in range(4): | ||
bot.forward(size) | ||
bot.left(90) | ||
|
||
bot.penup() | ||
|
||
box(bot, 10) | ||
box(bot, 20) | ||
box(bot, 30) | ||
|
||
bot.done() | ||
|
||
__import__("menu") # optional return to turtleplotbot menu |
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,23 @@ | ||
''' | ||
The simple way to draw a box | ||
''' | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
bot.pendown() | ||
|
||
bot.forward(30) | ||
bot.left(90) | ||
|
||
bot.forward(30) | ||
bot.left(90) | ||
|
||
bot.forward(30) | ||
bot.left(90) | ||
|
||
bot.forward(30) | ||
bot.left(90) | ||
|
||
bot.done() | ||
|
||
__import__("menu") # optional return to turtleplotbot menu |
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,43 @@ | ||
''' | ||
Approximate a circle or ellipse using a `n` sided polygon | ||
''' | ||
|
||
import math | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
|
||
def circle(bot, radius_x, radius_y, sides): | ||
''' | ||
Approximate a circle or ellipse by drawing a `n` sided polygon | ||
Args: | ||
radius_x: horizonal radius | ||
radius_y: vertical radius | ||
sides: number of line segments to draw | ||
Note: | ||
To draw circle use the same value for both radii | ||
''' | ||
step = 2 * math.pi / sides | ||
|
||
for theta in range(0, 2 * math.pi, step): | ||
x = radius_x * math.cos(theta) | ||
y = radius_y * math.sin(theta) | ||
|
||
if theta is 0: | ||
start_x = x | ||
start_y = y | ||
bot.goto(x, y) | ||
bot.pendown() | ||
else: | ||
bot.goto(x, y) | ||
|
||
bot.goto(start_x, start_y) | ||
bot.penup() | ||
|
||
circle(bot, 30, 30, 20) | ||
bot.done() | ||
|
||
__import__("menu") # optional return to turtleplotbot menu |
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,8 @@ | ||
from turtleplotbot import TurtlePlotBot | ||
|
||
bot=TurtlePlotBot() | ||
bot.pendown() | ||
bot.circle(20,360) | ||
bot.done() | ||
|
||
__import__("menu") # optional return to turtleplotbot menu |
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,40 @@ | ||
""" | ||
menu_example.py - Show a menu of numbers that the user can select and show the | ||
number picked. Pressing the left button will exit the menu and program. | ||
""" | ||
|
||
import vga2_bold_16x16 as font | ||
import tftui | ||
|
||
def main(ui): | ||
""" | ||
Main routine | ||
""" | ||
|
||
menu = [ | ||
"One", | ||
"Two", | ||
"Three", | ||
"Four", | ||
"Five", | ||
"Six", | ||
"Seven", | ||
"Eight", | ||
"Nine" | ||
] | ||
|
||
option = 0 | ||
while option is not None: | ||
option = ui.menu("Pick a Number", menu, option) | ||
if option: | ||
ui.cls("You Picked:", 2) | ||
ui.center(menu[option], 3) | ||
ui.center("Press to", 5) | ||
ui.wait("Continue", 6) | ||
|
||
ui.cls("Bye!") | ||
|
||
main(tftui.UI(font,1)) | ||
|
||
__import__("menu") # return to turtleplotbot menu | ||
|
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,26 @@ | ||
''' | ||
Draw a `n` sided polygon | ||
''' | ||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
|
||
def polygon(bot, sides, length): | ||
''' | ||
Draw a 'sides' sided polygon | ||
Args: | ||
sides: number of sides in polygon | ||
length: length of eacg side | ||
''' | ||
angle = 360 / sides | ||
bot.pendown() | ||
for _ in range(sides): | ||
bot.forward(length) | ||
bot.right(angle) | ||
|
||
bot.penup() | ||
|
||
polygon(bot, 8, 20) | ||
bot.done() | ||
|
||
__import__("menu") # return to turtleplotbot menu |
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,28 @@ | ||
''' | ||
Draw a star | ||
''' | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
|
||
def star(bot, points, length): | ||
''' | ||
Draw a 'n' pointed star with 'length' sides | ||
Args: | ||
sides: number of points | ||
length: length of each side | ||
''' | ||
angle = 180.0 - 180.0 / points | ||
bot.pendown() | ||
|
||
for _ in range(points): | ||
bot.forward(length) | ||
bot.left(angle) | ||
bot.forward(length) | ||
|
||
bot.penup() | ||
|
||
star(bot, 5, 30) | ||
|
||
__import__("menu") # return to turtleplotbot menu |
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,13 @@ | ||
''' | ||
Write a message. | ||
''' | ||
|
||
from turtleplotbot import TurtlePlotBot | ||
bot=TurtlePlotBot() | ||
|
||
# make the text 2 times larger then the default | ||
bot.setscale(2) | ||
bot.write("Hello!", "fonts/scripts.fnt") | ||
bot.done() | ||
|
||
__import__("menu") # return to turtleplotbot menu |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.