Advertisement
justhrun

Arduino_IRTinyHash.h

Jul 11th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #define IRremote_h
  2.  
  3. // Results returned from the decoder
  4. class decode_results {
  5. public:
  6.   unsigned long value; // Decoded value
  7.   int bits; // Number of bits in decoded value
  8.   volatile unsigned int *rawbuf; // Raw intervals in .5 us ticks
  9.   int rawlen; // Number of records in rawbuf.
  10. };
  11.  
  12. // Decoded value for NEC when a repeat code is received
  13. #define REPEAT 0xffffffff
  14.  
  15. // main class for receiving IR
  16. class IRrecv
  17. {
  18. public:
  19.   IRrecv(int recvpin);
  20.   int decode(decode_results *results);
  21.   void enableIRIn();
  22.   void resume();
  23. private:
  24.   // These are called by decode
  25.   long decodeHash(decode_results *results);
  26.   int compare(unsigned int oldval, unsigned int newval);
  27. }
  28. ;
  29.  
  30. // Some useful constants
  31. #define USECPERTICK 50  // microseconds per clock interrupt tick
  32. #define RAWBUF 100 // Length of raw duration buffer
  33.  
  34. // Marks tend to be 100us too long, and spaces 100us too short
  35. // when received due to sensor lag.
  36. #define MARK_EXCESS 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement