Upload
austin-lucas
View
219
Download
1
Tags:
Embed Size (px)
DESCRIPTION
A presentation with some interesting animations
Citation preview
NXT-G Programming*Note: this presentation contains animations and is best viewed by pressing F5 or the button *
Mission: Rapid Blood Screening The purpose of this
mission is to hit the lever on the right hand side of the dispenser, knocking down the syringe it holds.
Completing this mission is worth 25 Points in the 2010-11 FLL Competition
Mission Map: Overview Completion of this
mission will require the robot to follow a line in it’s approach and have a manipulator designed to hit down that lever. Sta
rt
Knock
Down
Theoretical Robot Design Motor A is attached
to an arm-like device that is capable of swinging back and forth
Motor B is connected to the left wheel
Motor C is connected to the right wheel
CB
L.S.A
Psuedocode: articulating what should happen Move motors B and C forward
for 2 full rotations (gets robot out of base)
Follow line for 1400 degrees of motor B Places robot in front of the
syringe Move motor A 180 degrees
Hits the syringe Turn motor B 2 full rotations
Turns robot back around towards the base
Turn motors B & C unlimitedly until button on NXT device is pressed Puts robot back in the base
Line Follower
Knock DownReturn
NXT-G: The Actual CodeMove forward to get out of the baseUse (loop) the line follower with the condition of the rotations of encoder B being less than 1400 degrees.
NXT-G: The Actual CodeStop All MotorsMove Motor A Forward to Knock Down the Syringe
Turn Around
Return to base
Line Follower Segment IF the light sensor detects
a light surface Stop the right motor (C) move the left one (B) for
an unlimited period of time
This causes the robot to swing left
IF the light sensor detects a dark surface (the line) Stop the left motor (B) Move the right motor (C)
for an unlimited period of time
This causes the robot to swing right
Packaged as a reusable function
block
Line Follower: Line Responses
If the light sensor picks up a dark surface: The C motor stops
moving to prevent the sensor from going over the line.
The B motor begins to move It will be stopped once
the light sensor no longer detects the line
The result of one motor moving and the other staying constant is an arc motion.
CB
L.S.
Line Follower: Table Responses
If the light sensor picks up a light surface (not a line): The B motor stops
moving to stop the robot from moving away from the line
The C motor begins to move It will be stopped
once the light sensor detects the line
CB
L.S.
Printing Values to the Screen Takes the numeric
value of the angle motor B has moved over the course of the program
Converts that angle to text
Displays the text This is useful when
measuring the distance a robot traveled over a segment of the code.