// Tactile2.ino // // Gerard Paresys // 27 8 2023 // // Utilise la library Adafruit_DRV2605 // Utilise la library Adafruit BusIO // // OK Arduino UNO + ADAFRUIT DRV2605L // OK Adafruit Feather M0 Radio + ADAFRUIT DRV2605L #include #include "Adafruit_DRV2605.h" Adafruit_DRV2605 drv; void setup() { Serial.begin(9600); Serial.println("Adafruit DRV2605 Basic test"); if (! drv.begin()) { Serial.println("Could not find DRV2605"); while (1) delay(10); } drv.selectLibrary(1); // // 0 = Empty, 1-5 are ERM, 6 is LRA // I2C trigger by sending 'go' command // default, internal trigger when sending GO command drv.setMode(DRV2605_MODE_INTTRIG); } uint8_t effect = 1; int Compteur = 1; void loop() { // Serial.print("Effect #"); Serial.println(effect); if (Compteur == 1) { Serial.println("11.2 Waveform Library Effects List"); } if (Compteur == 1) { effect = 1; Serial.println(F("1 − Strong Click - 100%")); } if (Compteur == 2) { effect = 7; Serial.println(F("7 − Soft Bump - 100%")); } if (Compteur == 3) { effect = 14; Serial.println(F("14 − Strong Buzz - 100%")); } if (Compteur == 4) { effect = 15; Serial.println(F("15 − 750 ms Alert 100%")); } if (Compteur == 5) { effect = 16; Serial.println(F("16 − 1000 ms Alert 100%")); } if (Compteur == 6) { effect = 47; Serial.println(F("47 − Buzz 1 – 100%")); } if (Compteur == 7) { effect = 58; Serial.println(F("58 − Transition Click 1 – 100%")); } if (Compteur == 8) { effect = 82; Serial.println(F("82 − Transition Ramp Up Long Smooth 1 – 0 to 100%")); } if (Compteur == 9) { effect = 86; Serial.println(F("86 − Transition Ramp Up Short Smooth 1 – 0 to 100%")); } if (Compteur == 10) { effect = 92; Serial.println(F("92 − Transition Ramp Up Short Sharp 1 – 0 to 100%")); } if (Compteur == 11) { effect = 118; Serial.println(F("118 − Long buzz for programmatic stopping – 100%")); } if (Compteur == 12) { delay(10000); effect = 123; Serial.println(F("123 − Smooth Hum 5 (No kick or brake pulse) – 10%")); } // 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(3000); Compteur++; if (Compteur > 12) Compteur = 1; //117 }