Text of How to turn on the robot How to start Bluetooth How to connect to robot How to initialize the robot...
How to turn on the robot How to start Bluetooth How to connect to robot How to initialize the robot How to not break the robot Sec 9-2 - Getting Started How to start a python program Python commands How to get the robot to move forward How to get the robot to move backward How to stop How to control the speed Sec 9-3 - Scribbler movements Methods - code and call Functions code and call Sec 9-4 - Simple Functions (names) Parameters Sec 9-5 - Functions with Parameters and Return Values Sec 9-6 - Creating and Using Modules Loop While and Loop How to restart if you get lost Sec 9-7 - Simple Python Loops Sec 9-8 - Variables What you asked me to teach
How to take a picture Sec 9-9 - Taking Pictures Conditionals How to avoid obstacles Sec 9-10 - Making Decisions in Python How to identify the color How to tell it to find something How to use the camera as a guide How to analyze the picture Sec 9-11 - Image Processing and Perception What you asked me to teach
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 GUI) Know how to initialize the robot and issue basic commands
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.
Connecting to the robot 1.Insert the adaptor into the PC 2.Turn on your robot 3.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 Next 7.Find your Fluke and click Next
Connecting to the robot 7.The Adaptor should connect to the robot. Note the com port assigned to the connection You are now connected to your robot.
IDLE Python GUI A 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.
Getting ready for Python In your My Documents folder 1.Create a folder called My Python 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 My Python folder (Extract all files at the top of the explorer page).
IDLE Double click on start python in the My Python folder.
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
Python Alice had a language, but you didnt need to type it Method/ Function Parameter Comment Statement/ Command
Python You type the code Many of the constructs are very similar Method/ Function Parameter Comment Statement/ Command
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
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 dont remember the com port, go back to the Bluetooth Manager and click on details.
Establishing a software link to the robot If correct your robot should play a tune and report back its name.
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!
Rest of today Form your group 3 people to a group Pick a robot. This will be you teams robot for the remainder of the year. 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!