Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. /**
  2. * \file main.h
  3. *
  4. * Contains common definitions and header files used throughout your PROS
  5. * project.
  6. *
  7. * Copyright (c) 2017-2018, Purdue University ACM SIGBots.
  8. * All rights reserved.
  9. *
  10. * This Source Code Form is subject to the terms of the Mozilla Public
  11. * License, v. 2.0. If a copy of the MPL was not distributed with this
  12. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  13. */
  14.  
  15. #ifndef _PROS_MAIN_H_
  16. #define _PROS_MAIN_H_
  17.  
  18. /**
  19. * If defined, some commonly used enums will have preprocessor macros which give
  20. * a shorter, more convenient naming pattern. If this isn't desired, simply
  21. * comment the following line out.
  22. *
  23. * For instance, E_CONTROLLER_MASTER has a shorter name: CONTROLLER_MASTER.
  24. * E_CONTROLLER_MASTER is pedantically correct within the PROS styleguide, but
  25. * not convienent for most student programmers.
  26. */
  27. #define PROS_USE_SIMPLE_NAMES
  28.  
  29. /**
  30. * If defined, C++ literals will be available for use. All literals are in the
  31. * pros::literals namespace.
  32. *
  33. * For instance, you can do `4_mtr = 50` to set motor 4's target velocity to 50
  34. */
  35. #define PROS_USE_LITERALS
  36.  
  37. #include "api.h"
  38.  
  39. /**
  40. * You should add more #includes here
  41. */
  42. #include "okapi/api.hpp"
  43. //#include "pros/api_legacy.h"
  44.  
  45. /**
  46. * If you find doing pros::Motor() to be tedious and you'd prefer just to do
  47. * Motor, you can use the namespace with the following commented out line.
  48. *
  49. * IMPORTANT: Only the okapi or pros namespace may be used, not both
  50. * concurrently! The okapi namespace will export all symbols inside the pros
  51. * namespace.
  52. */
  53. // using namespace pros;
  54. // using namespace pros::literals;
  55. using namespace okapi;
  56. using pros::delay;
  57. using pros::Task;
  58. using pros::millis;
  59. using pros::ADIAnalogIn;
  60.  
  61. namespace lcd {
  62. using namespace pros::lcd;
  63. }
  64.  
  65. #include "systems/drive.hpp"
  66. #include "systems/catapult.hpp"
  67.  
  68. /**
  69. * Prototypes for the competition control tasks are redefined here to ensure
  70. * that they can be called from user code (i.e. calling autonomous from a
  71. * button press in opcontrol() for testing purposes).
  72. */
  73. #ifdef __cplusplus
  74. extern "C" {
  75. #endif
  76. void autonomous(void);
  77. void initialize(void);
  78. void disabled(void);
  79. void competition_initialize(void);
  80. void opcontrol(void);
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84.  
  85. #ifdef __cplusplus
  86. /**
  87. * You can add C++-only headers here
  88. */
  89. //#include <iostream>
  90. #endif
  91.  
  92. #endif // _PROS_MAIN_H_
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement