Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Array printing

  • Loading branch information...
commit 9914e3436547e1f0375a8f7453e7d1fa52660569 1 parent ccf89c5
@ladyada ladyada authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 rawirdecode.pde
View
14 rawirdecode.pde
@@ -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};");
}
Please sign in to comment.
Something went wrong with that request. Please try again.