Intro C++ Programming WINDSOR-ESSEX FIRST ROBOTICS .

download Intro C++ Programming WINDSOR-ESSEX FIRST ROBOTICS .

If you can't read please download the document

Transcript of Intro C++ Programming WINDSOR-ESSEX FIRST ROBOTICS .

  • Slide 1
  • Intro C++ Programming WINDSOR-ESSEX FIRST ROBOTICS WWW.WINDSORESSEXFIRST.ORG
  • Slide 2
  • What will we cover today Understanding the sample code Understanding of basic C++ operations and data structures Resources for continued learning
  • Slide 3
  • Technical Resources The FRC website has GREAT resources for this years new hardware. https://wpilib.screenstepslive.com/s/4485https://wpilib.screenstepslive.com/s/4485 Covers Labview, C++, and Java
  • Slide 4
  • More Resources Chief Delphi http://www.chiefdelphi.com/forums/portal.php Great resource A forum with other FRC students, sharing and answering questions
  • Slide 5
  • Sample C++ Code
  • Slide 6
  • Variables A variable is a container for data that needs to be used for other steps. Int, Float, Boolean are simple data variables RobotDrive, Joystick are complex objects. These objects store lots of data in a known structure.
  • Slide 7
  • Sample C++ Code Functions Contain code that can be easily called by other code If a section of code will be reused in more than one place, a function is an easy way to keep your code organized, as well as easy to change in the future
  • Slide 8
  • Sample C++ Code Loops A code loop will loop until conditions are no longer met. In this case, we will loop through the tele operated code until we are no longer Enabled or In Tele Operated Mode.
  • Slide 9
  • Sample C++ Code Object Structures - RobotDrive RobotDrive is a data structure that contains both variables and functions In C++ these variables and functions can be accessed using the . or -> to refer to an objects structure. Example myDrive.arcadeDrive(driveStick)
  • Slide 10
  • Sample C++ Code Object Structures Jaguar *exampleJaguar = new Jaguar(0); exampleJaguar->Set(0.7); gyro = new Gyro(1); double angle = gyro.getAngle();
  • Slide 11 > i; cout > i; cout