Untitled


SUBMITTED BY: Guest

DATE: Nov. 23, 2013, 4:37 a.m.

FORMAT: Text only

SIZE: 1.6 kB

HITS: 981

  1. /*
  2. ** @author Eugene Andruszczenko
  3. ** @version 0.3
  4. ** @date November 5th, 2013
  5. ** @description This is an all in one GameEngine based on the 4d systems displays
  6. */
  7. /*
  8. ** @description include required files
  9. */
  10. #include "arduino.h"
  11. /*
  12. ** @description arduino library include files
  13. ** @description Picaso libraries are available from 4d Systems GitHub https://github.com/4dsystems/Picaso-Serial-Arduino-Library
  14. */
  15. #include <SPI.h>
  16. #include <SoftwareSerial.h>
  17. #include <Picaso_Serial_4DLib.h>
  18. #include <Picaso_const4D.h>
  19. /*
  20. ** @description Game Engine include files
  21. */
  22. #include "GameEngine.h"
  23. /*
  24. ** @description Game Engine class declaration
  25. */
  26. GameEngine *GE;
  27. /*
  28. ** @param wait {long} delay between loops
  29. ** @param now {unsigned long} timestamp millis()
  30. */
  31. long wait = 100;
  32. unsigned long now;
  33. /*
  34. ** @method setup
  35. ** @description main arduino setup
  36. */
  37. void setup()
  38. {
  39. /*
  40. ** @description if CPU is defined, change the timers accordingly
  41. */
  42. #ifdef CPU
  43. TCCR1B = TCCR1B & 0b11111000 | CPU;
  44. TCCR1B = TCCR1B & 0b11111000 | CPU;
  45. TCCR2B = TCCR2B & 0b11111000 | CPU;
  46. #endif
  47. /*
  48. ** @description Game Engine class instantiation
  49. */
  50. GE = new GameEngine();
  51. /*
  52. ** @description set initial value to now
  53. */
  54. now = millis()+wait;
  55. }
  56. /*
  57. ** @method loop
  58. ** @description main arduino loop
  59. */
  60. void loop()
  61. {
  62. /*
  63. if(millis() > now)
  64. {
  65. now+=wait;
  66. GE->Core();
  67. }
  68. */
  69. GE->Core();
  70. }

comments powered by Disqus