Skip to content

Instantly share code, notes, and snippets.

@axelerator
Created October 18, 2018 02:15
Show Gist options
  • Save axelerator/c6eef515da9149b12fe04b7728b8d9a1 to your computer and use it in GitHub Desktop.
Save axelerator/c6eef515da9149b12fe04b7728b8d9a1 to your computer and use it in GitHub Desktop.
Customize play function to support different frequencies
void handlePlay() {
String response = "POSTED";
response += server.arg("timings");
readCSV(server.arg("timings"));
for (int i = 0; i < current_data_length; ++i) {
Serial.println(signal_data[i]);
}
int frequency = server.arg("frequency").toInt();
irsend.sendRaw(signal_data, current_data_length, frequency); // Send a raw data capture at frequency given as request parameter.
server.sendHeader("Access-Control-Allow-Origin", "*");
server.send(200, "text/plain", response);
}
@axelerator
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment