Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This #include statement was automatically added by the Particle IDE.
- #include <adafruit-drv2605-photon.h>
- Adafruit_DRV2605 drv;
- void setup() {
- Serial.begin(9600);
- Serial.println("DRV test");
- drv.begin();
- drv.selectLibrary(1);
- // I2C trigger by sending 'go' command
- // default, internal trigger when sending GO command
- drv.setMode(DRV2605_MODE_INTTRIG);
- }
- uint8_t effect = 1;
- void loop() {
- Serial.print("Effect #"); Serial.println(effect);
- // set the effect to play
- drv.setWaveform(0, effect); // play effect
- drv.setWaveform(1, 0); // end waveform
- // play the effect!
- drv.go();
- // wait a bit
- delay(1000);
- effect++;
- if (effect > 117) effect = 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement