Advertisement
Guest User

Untitled

a guest
Mar 7th, 2013
12
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef tetris_h
  2. #define tetris_h
  3.  
  4. #include "Bloc.h"
  5.  
  6. #include <ht1632c.h>
  7. #include <Arduino.h>
  8.  
  9. #define HEURE_DIZAINES      1
  10. #define HEURE_UNITES        2
  11. #define MINUTE_DIZAINES     3
  12. #define MINUTE_UNITES       4
  13.  
  14. #define TETRIS_WIDTH 6
  15. #define TETRIS_HEIGHT 10
  16. #define TETRIS_PADDING 2
  17.  
  18. #define ARRAYSIZE(x)  (sizeof(x) / sizeof(x[0]))
  19.  
  20. class Tetris
  21. {
  22.   public:
  23.     Tetris();
  24.  
  25.     void setDate(byte heureD, byte heureU, byte minuteD, byte minuteU);
  26.     void init(byte heureD, byte heureU, byte minuteD, byte minuteU);
  27.  
  28.   private:
  29.     void check(byte type, byte number);
  30.     void change(byte type, byte number);
  31.     void getPosition(byte &posX, byte &posY, byte number, byte k);
  32.     void setHistorique();
  33.     void displayBloc(byte bloc, byte type, byte x, byte y);
  34.  
  35.     // Fonctions graphiques
  36.     void writeDots();
  37.     void writeCloud();
  38.     void writeEmail();
  39.  
  40.     // Variables pour l'heure
  41.     int hD;
  42.     int hU;
  43.     int mD;
  44.     int mU;
  45.  
  46.     unsigned long time;
  47.     unsigned int delay;
  48.     Bloc b;
  49.  
  50.     ht1632c ledM; //  = ht1632c(&PORTD, 7, 6, 4, 5, GEOM_32x16, 2);
  51.  
  52.     unsigned long number1lastUpdate;
  53.     unsigned int number1CurrentStep;
  54.  
  55.     unsigned long number2lastUpdate;
  56.     unsigned int number2CurrentStep;
  57.  
  58.     unsigned long number3lastUpdate;
  59.     unsigned int number3CurrentStep;
  60.  
  61.     unsigned long number4lastUpdate;
  62.     unsigned int number4CurrentStep;
  63.  
  64.     Bloc historique[10][20];
  65. };
  66.  
  67. #endif
Advertisement
RAW Paste Data Copied
Advertisement