1 void output(unsigned long decimal, unsigned int length, unsigned int delay, unsigned int* raw, unsigned int protocol) {
4 Serial.print("Unknown encoding.");
6 char* b = dec2binWzerofill(decimal, length);
7 Serial.print("Decimal: ");
10 Serial.print( length );
11 Serial.print("Bit) Binary: ");
13 Serial.print(" Tri-State: ");
14 Serial.print( bin2tristate( b) );
15 Serial.print(" PulseLength: ");
17 Serial.print(" microseconds");
18 Serial.print(" Protocol: ");
19 Serial.println(protocol);
22 Serial.print("Raw data: ");
23 for (unsigned int i=0; i<= length*2; i++) {
32 static const char* bin2tristate(char* bin) {
33 static char returnValue[50];
36 while (bin[pos]!='\0' && bin[pos+1]!='\0') {
37 if (bin[pos]=='0' && bin[pos+1]=='0') {
38 returnValue[pos2] = '0';
39 } else if (bin[pos]=='1' && bin[pos+1]=='1') {
40 returnValue[pos2] = '1';
41 } else if (bin[pos]=='0' && bin[pos+1]=='1') {
42 returnValue[pos2] = 'F';
44 return "not applicable";
49 returnValue[pos2] = '\0';