#include "respeaker.h"
uint8_t offset = 0;
void setup() {
respeaker.begin();
respeaker.pixels().set_brightness(128); // set brightness level (from 0 to 255)
}
void loop() {
respeaker.pixels().rainbow(offset++);
delay(10);
}
#include "respeaker.h"
// wav or mp3 files on SD card
const char *sound_map[] = {"a1.wav", "b1.wav", "c1.wav", "d1.wav", "e1.wav", "f1.wav", "g1.wav", "c2.wav"};
void setup() {
respeaker.begin();
respeaker.attach_touch_handler(touch_event); // add touch event handler
}
void loop() {}
// id: 0 ~ 7 - touch sensor id; event: 1 - touch, 0 - release
void touch_event(uint8_t id, uint8_t event) {
if (event) {
respeaker.play(sound_map[id]);
}
}
#include "respeaker.h"
#define IFTTT_MAKER_CHANNEL_KEY "" // add the key of your ifttt maker channel
#define EVENT "ping"
const char *ifttt_ping = "curl -X POST https://maker.ifttt.com/trigger/" EVENT "/with/key/" IFTTT_MAKER_CHANNEL_KEY;
void setup() {
respeaker.begin();
respeaker.attach_touch_handler(touch_event); // add touch event handler
}
void loop() {}
// id: 0 ~ 7 - touch sensor id; event: 1 - touch, 0 - release
void touch_event(uint8_t id, uint8_t event) {
if (event == 1 && id == 0) {
respeaker.exec(ifttt_ping);
}
}