Knowledge Base‎ > ‎Robotics‎ > ‎

NXC Tutorial / Review

Preparation


Make sure you have grabbed the Mindstorms folder in Pickup.  Make sure you have a working robot to use - build the Tribot - instructions in the Mindstorms folder. Charge your battery.

Inside it you will find:
  • NXC_tutorial as a PDF
  • A folder of sample code called nxc_tutorial_code
Work through the following tutorials. At any point that you are stuck make sure to:
  • Try running the given sample code
  • Try compiling code and if you can't find errors ask a classmate for help
  • When you ask for help instead of "I don't know what's going on" formulate specific questions:
    • Why do I have an error at line 10?
    • Why won't my motor command turn properly?
    • What is the number in the repeat command for?

Tutorial

  • Writing and running code
  • Finding compilation errors
  • What is task main?
  • Starting and stopping motors
  • Pausing between instructions
  • Making code more readable - constants
  • Using motors to turn (and to go in a more straight line)
  • Repeating things
  • Getting information from a sensor
  • Using information to make a decsion
  • Storing and updating information - variables
  • Playing music

Starting Points for Summative Challenges

  • Playing a song
  • Line following
  • Forklift
  • Additional project (level 4)
Subpages (1): Writing and Running Code
Comments