Permalink
Browse files

Added Array printing

  • Loading branch information...
1 parent ccf89c5 commit 9914e3436547e1f0375a8f7453e7d1fa52660569 @ladyada ladyada committed Oct 6, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 rawirdecode.pde
View
@@ -86,4 +86,18 @@ void printpulses(void) {
Serial.print(pulses[i][1] * RESOLUTION, DEC);
Serial.println(" usec");
}
+
+ // print it in a 'array' format
+ Serial.println("int IRsignal[] = {");
+ Serial.println("// ON, OFF (in 10's of microseconds)");
+ for (uint8_t i = 0; i < currentpulse-1; i++) {
+ Serial.print("\t"); // tab
+ Serial.print(pulses[i][1] * RESOLUTION / 10, DEC);
+ Serial.print(", ");
+ Serial.print(pulses[i+1][0] * RESOLUTION / 10, DEC);
+ Serial.println(",");
+ }
+ Serial.print("\t"); // tab
+ Serial.print(pulses[currentpulse-1][1] * RESOLUTION / 10, DEC);
+ Serial.print(", 0};");
}

0 comments on commit 9914e34

Please sign in to comment.