madison_wcb package¶
Subpackages¶
Submodules¶
madison_wcb.wcb module¶
-
madison_wcb.wcb.
brush_down
()¶ Puts the brush in its “down” position, so that it touches the paper.
-
madison_wcb.wcb.
brush_up
()¶ Puts the brush in its “up” position, so that it doesn’t touch the paper.
-
madison_wcb.wcb.
cleanup
()¶ IMPORTANT: Call this function at the end of your program.
-
madison_wcb.wcb.
get_color
(index)¶ Dips the brush in paint.
- Arguments:
- index - an integer between 0 and 7, inclusive. Tells the bot which color you want.
-
madison_wcb.wcb.
get_distance_traveled
()¶ Returns a number like 123, representing the distance that the brush has traveled since the last time that it was dipped in paint or water.
NOTE: Only tracks movement triggered by calls to the move_forward() function. Movement caused by move_to() is _not_ recorded.
This number represents the number of “steps” that the brush has traveled, not the number of inches or centimeters; you’ll have to do some experimentation on your own to figure out e.g. how many centimeters 100 steps is equal to.
-
madison_wcb.wcb.
get_position
()¶ Returns the brush’s current position.
- Return value:
- A list like [-102, 50] representing the brush’s current [x, y] position.
-
madison_wcb.wcb.
get_x
()¶ Returns the brush’s current x-coordinate.
- Return value:
- A number between -250 and 250, represnting the brush’s current horizontal position.
-
madison_wcb.wcb.
get_y
()¶ Returns the brush’s current y-coordinate.
- Return value:
- A number between -180 and 180, representing the brush’s current vertical position.
-
madison_wcb.wcb.
initialize
()¶ IMPORTANT: Call this function at the beginning of your program.
-
madison_wcb.wcb.
move_forward
(num_steps)¶ Moves the brush forward a few steps in the direction that its “turtle” is facing.
- Arguments:
- num_steps - a number like 20. A bigger number makes the brush move farther.
-
madison_wcb.wcb.
move_to
(x, y)¶ Moves the brush to a particular position.
- Arguments:
- x - a number between -250 and 250. y - a number between -180 and 180.
-
madison_wcb.wcb.
park
()¶ Park the watercolorbot’s brush in the top-left corner.
-
madison_wcb.wcb.
point_in_direction
(angle)¶ Points the brush’s “turtle” in the direction of the angle specified.
- Arguments:
- angle - a number between 0 and 360.
-
madison_wcb.wcb.
set_reinking_distance
(distance_in_cm)¶ Sets the number of centimeters the bot will draw before re-inking the brush with the last used paint.
- Arguments:
- distance_in_cm - an integer representing a number of centimeters.
-
madison_wcb.wcb.
turn_left
(relative_angle)¶ Turns the brush’s “turtle” to the left.
- Arguments:
- relative_angle - a number like 10.
- A bigger number makes the turtle turn farther to the left.
-
madison_wcb.wcb.
turn_right
(relative_angle)¶ Turns the brush’s “turtle” to the right.
- Arguments:
- relative_angle - a number like 10.
- A bigger number makes the turtle turn farther to the right.
-
madison_wcb.wcb.
wash_brush
()¶ Wash the brush in water.