getting started sec 9-2 web design. objectives the student will: know to establish a bluetooth link...
TRANSCRIPT
![Page 1: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/1.jpg)
Getting Started
Sec 9-2Web Design
![Page 2: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/2.jpg)
Objectives
The student will:• Know to establish a Bluetooth link to the
Scribbler robot.• Know to start IDLE (the Python GUI)• Know how to initialize the robot and issue
basic commands
![Page 3: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/3.jpg)
Bluetooth
• You have been provided with an Azio bluetooth dongle– It is your responsibly to make sure that the
adaptor is put away with the robot at the end of class. I do not have any spare adaptors. If you lose yours you will be at the mercy of the other teams to share theirs.
![Page 4: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/4.jpg)
Connecting to the robot1. Insert the adaptor into the PC2. Turn on your robot3. On the front of the Fluke card note the number
under the bar code.4. In the task bar click on Bluetooth manager:5. Click on: 6. Select “Express mode” and click Next7. Find your Fluke and click Next
![Page 5: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/5.jpg)
Connecting to the robot7. The Adaptor should connect to the robot.– Note the com port assigned to the connection
You are now connected to your robot.
![Page 6: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/6.jpg)
IDLE Python GUIA graphical user interface (GUI) is a human-
computer interface (i.e., a way for humans to interact with computers) that uses windows, icons and menus and which can be manipulated by a mouse (and often to a limited extent by a keyboard as well).
IDLE is a GUI but uses the keyboard for input.
![Page 7: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/7.jpg)
Getting ready for Python
• In your My Documents or desktop folder…1. Create a folder called “myPython”2. From the Hancock website on the Web Design
page download the “start python.zip” file.3. Right mouse button on the zip file and Open
with Windows Explorer. Extract the file to your myPython folder (Extract all files at the top of the explorer page).
![Page 8: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/8.jpg)
IDLE• Double click on Start Python in the myPython
folder.
![Page 9: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/9.jpg)
Python
• From python.org“Python is a remarkably powerful dynamic programming language that is used in a wide
variety of application domains.”• Python is a programming language– It has a specific syntax • Punctuation, indentation, etc.
– It has rules• Upper and lower case letters are different
![Page 10: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/10.jpg)
Python• Alice had a language, but you didn’t need to
type it…
Method/Function
Parameter
Comment
Statement/Command
![Page 11: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/11.jpg)
Python• You type the code• Many of the
constructs are very similar
Method/Function
Parameter
Comment
Statement/Command
![Page 12: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/12.jpg)
Software Libraries• Software libraries are predetermined
functions that are provided to the programmer.
• For scribbler will be my using the myro library. (Myro is short for “my robot”)
• Most programming languages have a way of including a library. In Python you type:
from myro import *– The * means “import everything from the library”
![Page 13: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/13.jpg)
Establishing a software link to the robot• Now that you have the “myro” functions
available, you can establish a software link to your robot.
• Python functions are called by typing:function(parameters)
• The function to link to the robot is:initialize(“comX”)
– comX is the com port that was listed when the Bluetooth connected to the robot. If you don’t remember the com port, go back to the Bluetooth Manager and click on details.
![Page 14: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/14.jpg)
Establishing a software link to the robot
• If correct your robot should play a tune and report back it’s name.
![Page 15: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/15.jpg)
Test your robot
• Now that you have a link to your robot you can test the link.– Put you robot on the floor (if you break your
robot, it will be hard to finish the class)– Type joyStick()• Note that joystick() is not the same as joyStick()• Capital letters matter!
– Drive your robot around. Note that the front of your robot is the part where the Fluke card is!
![Page 16: Getting Started Sec 9-2 Web Design. Objectives The student will: Know to establish a Bluetooth link to the Scribbler robot. Know to start IDLE (the Python](https://reader036.vdocuments.us/reader036/viewer/2022081700/56649e9e5503460f94b9f603/html5/thumbnails/16.jpg)
Rest of today…
• Test your robot.• Also try issuing the commands:
beep(1, 880)move(1, 1)
• Read Chapter 1 in the book.– You must read!!– Do not change the name of your robot!