Sie sind auf Seite 1von 3

Gyroscope Graphics:

Team Leader: Jonathan Rotter


Set up:

Open terminal

Type cd desktop to go to your desktop

Type nano graphicstest.py to create a python file called graphicstest which you will be working with

mcsp.wartburg.edu/zelle/python/graphics.py is a file called graphics.py move it to your desktop

Now in the terminal window (in nano) type:

from graphics import *

def main():
win = GraphWin("My Circle", 500, 500)

Circle(Point(50,50), 10).draw(win)

win.getMouse() # Pause to view result


win.close() # Close window when done

main()

Save the file by typing Control-o and then Enter.

Type Control-x to exit nano

Then type python graphicstest.py to run the file you just wrote.

(it should give you a circle)

Now you are set up to start working with graphics in python. Your job is to work together to create a
method to draw the path that the ROV takes using input data from the gyroscope. The gyroscope gives
you 4 things: acceleration and rotation in the x, y, and z direction. Try to add scale, boundaries, distance
travelled, and the current field of vision if possible. If you do not know much about python, try working
with the math to create a way to measure distance travelled, current position/direction in real time.

This is the library I used:

http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/graphics.html
Connecting Pi to Arduino

https://diyhacking.com/connect-interface-raspberry-pi-arduino/

Follow this tutorial. Instead of communicating Hello World, please have it communicate the
Gyroscope data. One possible form might be (Acceleration,RotationX,RotationY,RotationZ)

You will probably end up having to change these lines.

if(read_ser=="Hello From Arduino!"):


blink(11)

Connecting Pi to Arduino

https://diyhacking.com/connect-interface-raspberry-pi-arduino/

Follow this tutorial. Instead of communicating Hello World, please have it communicate the
Gyroscope data. One possible form might be (Acceleration,RotationX,RotationY,RotationZ)

You will probably end up having to change these lines.

if(read_ser=="Hello From Arduino!"):


blink(11)

Connecting Pi to Arduino

https://diyhacking.com/connect-interface-raspberry-pi-arduino/

Follow this tutorial. Instead of communicating Hello World, please have it communicate the
Gyroscope data. One possible form might be (Acceleration,RotationX,RotationY,RotationZ)

You will probably end up having to change these lines.

if(read_ser=="Hello From Arduino!"):


blink(11)
Claw
Congrats, you have laser-cut a prototype claw. Assemble and test it, and decide what changes you need
to make.

If needed, have one group design and cut another prototype. Another group can try using the linear
slide to make the original prototype move!

Also, finish downloading AutoCad if you have not, because we will probably need to use it a lot in the
future as well.

I highly recommend learning AutoCad so you can specialize in designing and laser cutting parts for us!

https://www.thesourcecad.com/autocad-tutorials/

Part 1 section 4
Part 2 section 1 and 2
Part 3 section 5
Part 4 section 4

Claw
Congrats, you have laser-cut a prototype claw. Assemble and test it, and decide what changes you need
to make.

If needed, have one group design and cut another prototype. Another group can try using the linear
slide to make the original prototype move!

Also, finish downloading AutoCad if you have not, because we will probably need to use it a lot in the
future as well.

I highly recommend learning AutoCad so you can specialize in designing and laser cutting parts for us!

https://www.thesourcecad.com/autocad-tutorials/

Part 1 section 4
Part 2 section 1 and 2
Part 3 section 5
Part 4 section 4

Das könnte Ihnen auch gefallen