Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.

Similar presentations


Presentation on theme: "Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber."— Presentation transcript:

1 Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber

2 The Common Palette

3 MOVE Block This block will make your robot move (seriously. no kidding.)

4 MOVE Block Properties Port: the places on the Brick where your motors are hooked up Direction: what direction you want the motors to turn (or stop it completely)

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 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: From 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 use a virtual piano to make tones 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 the note to be played for

10 DISPLAY Block This block allows you to display things on your NXT Brick’s screen. It is useful when you want to see 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… Control – Choose of you are waiting for time or for 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 Properties Port: decide where your sensor is hooked up to the NXT Brick Action: should the sensor be pressed in, released, or bumped (pressed, then released) to continue on to the next step

16 Wait for the value of LIGHT to change Properties Until: wait until the value of light is greater than or less than a number value you specify Function: are you measuring the ambient light of the room (unchecked), or the reflected light of whatever the sensor’s pointing at (checked)?

17 Wait for SOUND Properties Until: the robot will wait until the sound level is higher or lower than your specified value

18 Wait for DISTANCE (ultrasonic) Properties 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… …Or you could loop FOREVER AND EVER AND EVER …A SENSOR is activated … A TIMER is up …It has repeated a certain number of times (COUNT) … A value is true (LOGIC) …Or at least until you manually stop the program

20 Loop FOREVER Loops over and over and over again until you manually stop the program or the bot runs out of batteries (unlikely)

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 a motor 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 has reached a specified value You can also reset the timer with this block

26 Loop for a DISTANCE (ultrasonic) Loops until the robot senses that the distance to an object is greater then or less than a specified value

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 data wiring

30 Switch These are like “If…then…else” statements. IF this is true, THEN do one thing, if ELSE, do another thing.

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 Data 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.


Download ppt "Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber."

Similar presentations


Ads by Google