Download presentation
Presentation is loading. Please wait.
Published byLily Sherman Modified over 9 years ago
1
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber
2
The Common Palette
3
MOVE Block This block will make your robot move
4
MOVE Block Function Editor Port: the places where your motors are hooked up Direction: what direction you want the motors to turn
5
Steering: Slows down one motor and speeds up another to make your robot turn. Duration: how long, # of rotations (of motor), # of degrees (of motor), seconds, etc. Next Action: Do you want a complete stop (BRAKE) or to coast to a stop?
6
RECORD/PLAY Block You can move you’re your robot manually and this will record the actions your robot is taking in a program. You can later play it back. Pros: Can come in handy to help troubleshoot Cons: It is saved in a temporary file so when you turn off the robot, it is gone, and it takes up a lot of memory
7
RECORD/PLAY Function Editor Action: Are you recording or playing the actions? Recording: Which ports are you recording? Time: How long are you going to record for?
8
SOUND Block Use this if you would like for your robot to “say” something. You can use words already available or create your own files. This does take up quite a bit of your memory The sounds are not very loud
9
SOUND Block Function Editor Action: Sound File-choose from a ready made file or one you provide Action: Tone-gives you a keyboard to program how long you want certain notes to be played for)
10
DISPLAY Block This block allows you to display things on your NXT Brick It is useful when you want to see a how long a count or timer has been going in a program. It can also display pictures
11
DISPLAY Block Function Editor Action: choose from an image, text, drawing or to reset the screen File: choose what you want displayed Position: where on the screen do you want the image, centered, to the left, etc.
12
WAIT FOR…Blocks These blocks make the robot pause until either the time is up or a value is true Time Touch Light Sound Distance (ultrasonic)
13
Choosing what you want to wait for… Choose if you are waiting for time or a sensor
14
Wait for TIME Function Editor Until: Decide how many seconds you want the robot to wait.
15
Wait for the TOUCH sensor Function Editor Port: decide where your sensor is hooked up to the NXT Brick Action: should the sensor be pressed in, released, or bumped to continue on to the next step
16
Wait for the value of LIGHT to change Function Editor Until: wait until the value of light is greater than or less than a number value you specify Function: you can have the sensor generate light if you need it to
17
Wait for SOUND Function Editor Until: the robot will wait until the sound level is higher or lower than your specified value
18
Wait for DISTANCE (ultrasonic) Function Editor Until: The distance is greater than or less than your designated distance. Distance can be measured in inches or centimeters
19
Loop The sequence of blocks inside of the loop will repeat over and over or until the value is true Loop FOREVER Loop until SENSOR is activated Loop for a certain amount of TIME Loop for a certain COUNT Loop until a value is true (LOGIC)
20
Loop FOREVER Loops over and over and over again.
21
Loop TOUCH SENSOR Loops until a sensor is activated, in this case, TOUCH Sensor
22
Loop LIGHT SENSOR Loops until the value of light is changed
23
Loop ROTATION SENSOR Loops until the rotation sensor has rotated a certain number of degrees or a certain number of rotations. You can also reset the rotation sensor with this block
24
Loop SOUND SENSOR Loops until the sound sensor has detected a designated level of sound.
25
Loop TIMER Loops until a timer is greater than or less than a specific value. You can also reset the time with this block
26
Loop for a DISTANCE (ultrasonic) Loops until the robot has gone less than or greater than a specified distance.
27
Loop TIME Loop for a specified number of seconds
28
Loop COUNT Loops a certain number of times (e.g. if you put 4, it will repeat the program inside the loop 4 times)
29
Loop (Logic) Loops until a value is true. This requires wiring
30
Switch These are like “If…then…else” statements. IF this is true, do this, if ELSE, THEN do this.
31
Switch TOUCH Sensor IF the touch sensor is pressed, released or bumped (you select), THEN do what ever your commands are on the top. Else, do your commands on the bottom
32
Switch LIGHT Sensor IF the value of light is less than or greater (you decide) a value, THEN do what is the top of your switch ELSE do what is the bottom of your switch
33
Switch ULTRASONIC Sensor IF the distance is a certain value, THEN do what is in the top of your switch ELSE do what is in the bottom of the switch
34
Switch ROTATION Sensor IF the rotation sensor has gone a specified amount of degrees or rotations, THEN do the top commands, ELSE do the bottom commands
35
Switch TIMER IF the timer reads a certain number THEN do the commands in the top, ELSE, do the commands in the bottom You can also reset the timer
36
Switch SOUND Sensor IF the sound has reached a certain level or below that level, THEN, do the commands in the top ELSE, do the commands in the bottom
37
Switch LOGIC IF a value is true/false, THEN do the commands in the top ELSE do the commands in the bottom Requires Wiring
38
The END You have now completed Programming 101, The Common Palette This is a working document so please do not consider it the end all to basic programming with the NXT, but hopefully it will get you a good start.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.