Skip to content

Commit c512ffa

Browse files
committed
example: extend basic vibro with different intensity
1 parent 3171b82 commit c512ffa

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

examples/Modulino_Vibro/Basic/Basic.ino

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ void setup() {
88
}
99

1010
void loop() {
11-
vibro.on(1000);
11+
// Cycle through vibration intensities from GENTLE to MAXIMUM
12+
// Each intensity increases by 5, lasting 1 seconds each
13+
for (int intensity = GENTLE; intensity <= MAXIMUM; intensity += 5) {
14+
Serial.println(intensity);
15+
vibro.on(1000, true, intensity);
16+
vibro.off();
17+
delay(100);
18+
}
19+
20+
// Two vibration of one second separated by a long pause
21+
// using the blocking on call
1222
delay(1000);
13-
vibro.off();
23+
vibro.on(1000);
24+
delay(5000);
25+
vibro.on(1000);
1426
delay(1000);
1527
}

0 commit comments

Comments
 (0)