Instruction Guide: The NXT Computer

This lesson applies the learning from the Introduction to Computers lesson on the parts of a computer to the particulars of the NXT. Students also get a early glimpse of the NXT programming environment.

The Four Parts of the NXT Computer (see NXT Computer PPT : slide 1

Inputs– Sensors, brick buttons, motor encoder

Outputs – Motors, lights, brick screen, brick speaker

Processor – Brick processor

Storage –Brick memory chips – for firmware and software

  • Revisit processor and memory chips inside brick ( slide 2)
    • Flash memory chips storage the manufacturer’s firmware and user’s software

The NXT Motor – Output or Input? ( slide 3)

  • Answer: Both
    • Spinning motor is an output of the NXT computer
    • Semiconductor encoders are an input to the NXT computer
      • Students saw this in “View Mode” with motor
      • Motor encoders can tell NXT how many times the motor has been rotated

NXT Computer Demo

Goals:

  • Demonstrate the four part of the NXT Computer
  • Emphasis is on Storage (students more readily grasp Input, Output, and Processor), specifically the Flash Memory Chip inside the NXT brick
  • Provide students their first glimpse of NXT-G programming software

Setup:

  • Connect a motor to any port (A, B, or C)
  • Connect a Touch Sensor to Port 1
  • Connect NXT to computer with USB cable
  • Start NXT-G software on computer
  • Under “File”, select “New
  • Place NXT and sensor under a Document Camera

Procedure 1 (Explore existing contents of Flash Memory)

  • Show student NXT-G software and explain this is the environment they will be programming in
    • No need to explain icons or features at this time – this is just a teaser
  • In the lower right of the programming field, there should be five buttons in a square-within-a-square pattern
    • Select the upper left button (with the embossed brick icon)
    • This should open a window with the “Communications” tab selected
  • Turn on the brick
    • It should show up in the Communications window as “available”
  • Select the available brick and press the “Connect” button
    • The “NXT Data” panel at the right side of the Communication window should populate with data from your brick
      • Name: the name can be changed from this window
      • Battery: show the current voltage of the brick’s battery
      • Connection: shows the brick is connected through the USB cable
      • Free Storage: shows the amount of free space on the NXT Flash Memory Chip
        • Note: NXT memory is measured in KB (KiloBytes)
        • Ask student what kilo means (1,000 or 0.001 MegaBytes)
        • NXT memory is very small, so learning to write efficient programs is very important
      • Firmware Version: show version number of firmware stored in brick
      • Select “Memory” tab (next to “Communication” tab in window)
        • This view shows the contents of the NXT Flash Memory Chip
        • The bar graph on the right graphically shows how much memory is used
        • By clicking on the underlined category headings (next to the various colored bar graph segments) the details of this category of files is displayed in window
        • By selecting the “Show System Files” check box, some of the firmware files installed by the manufacturer are also displayed.
        • Categories may include: Unused, Other, Graphic, Sound, Programs
        • Select the “Show System Files” check box, and select the Other category
        • These are files per-installed by the manufacturer
          • The files named “Try-….” are the built in program we will be running in the next session of this unit
          • Select the “Close” button at the lower right of this window

Procedure 2 (Download a sample user program into the NXT Flash Memory Storage)

  • Use “File”, “Open….” to open the sample program file in NXT-G ( NXTComputerDemo.rbt )
  • Explain to students this is what their programs will look like in NXT-G
  • Ask students to guess what this program does, based on the icon blocks
    • Turn on motor
    • Wait for Touch Sensor to be pressed
    • Stop motor
    • Wait for 1 second
    • Make a Sound
    • Display something
    • Wait 10 seconds
  • In the lower right of the programming field, on the five button square-within-a-square pattern:
    • Select the lower left button (with the embossed downward arrow)
    • This downloads the open program to the brick
    • Wait for “Complete” to show in the Downloading dialog box
    • In the lower right of the programming field, on the five button square-within-a-square pattern:
      • Select the upper left button (with the embossed brick icon)
      • In the new window, select “Memory” tab (next to “Communication” tab)
      • Select the Program item next to the Flash Memory Bar Graph
      • A list of all the user programs will appear in the window
      • NXTCompterDemo should now be on that list
    • We successfully downloaded the sample program to the brick’s Flash Memory Storage

Procedure 3 (Run the sample program on the NXT computer)

  • Switch to the Document Camera view of the NXT brick, motor and touch sensor
  • From “My Files” > “Software Files”, select the NXTComputerDemo program
  • When you select “Run”, the selected program gets copied from the Flash memory into the RAM and the NXT processor will begin running the program:
    • Turn on motor – the motor will immediately start turning
    • Wait for Touch Sensor to be pressed – when you press the touch sensor, the program will move on
    • Stop motor – the motor will immediately stop
    • Wait for 1 second – there will be a one second pause
    • Make a Sound – the NXT will say “Good Job”
    • Display something – the NXT will display a smiley face
    • Wait 10 seconds – after a 10 second pause, the program will end