Advertisement
jgustavoam

Untitled

Jan 31st, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. /* Format for protocol definitions:
  2.  * {pulselength, Sync bit, "0" bit, "1" bit}
  3.  *
  4.  * pulselength: pulse length in microseconds, e.g. 350
  5.  * Sync bit: {1, 31} means 1 high pulse and 31 low pulses
  6.  *     (perceived as a 31*pulselength long pulse, total length of sync bit is
  7.  *     32*pulselength microseconds), i.e:
  8.  *      _
  9.  *     | |_______________________________ (don't count the vertical bars)
  10.  * "0" bit: waveform for a data bit of value "0", {1, 3} means 1 high pulse
  11.  *     and 3 low pulses, total length (1+3)*pulselength, i.e:
  12.  *      _
  13.  *     | |___
  14.  * "1" bit: waveform for a data bit of value "1", e.g. {3,1}:
  15.  *      ___
  16.  *     |   |_
  17.  *
  18.  * These are combined to form Tri-State bits when sending or receiving codes.
  19.  */
  20. #ifdef ESP8266
  21. static const RCSwitch::Protocol proto[] = {
  22. #else
  23. static const RCSwitch::Protocol PROGMEM proto[] = {
  24. #endif
  25.   { 350, {  1, 31 }, {  1,  3 }, {  3,  1 }, false },    // protocol 1
  26.   { 650, {  1, 10 }, {  1,  2 }, {  2,  1 }, false },    // protocol 2
  27.   { 100, { 30, 71 }, {  4, 11 }, {  9,  6 }, false },    // protocol 3
  28.   { 380, {  1,  6 }, {  1,  3 }, {  3,  1 }, false },    // protocol 4
  29.   { 500, {  6, 14 }, {  1,  2 }, {  2,  1 }, false },    // protocol 5
  30.   { 450, { 23,  1 }, {  1,  2 }, {  2,  1 }, true }      // protocol 6 (HT6P20B)
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement