Skip to content

Commit ef67ace

Browse files
add joystick and vibro examples
1 parent 67e04d3 commit ef67ace

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "Modulino.h"
2+
3+
ModulinoJoystick joystick;
4+
5+
void setup() {
6+
Serial.begin(9600);
7+
Modulino.begin();
8+
joystick.begin();
9+
}
10+
11+
void loop() {
12+
joystick.update();
13+
14+
if(joystick.isPressed()) {
15+
Serial.println("Pressed");
16+
}
17+
18+
Serial.print("x,y: ");
19+
Serial.print(joystick.getX());
20+
Serial.print(", ");
21+
Serial.println(joystick.getY());
22+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "Modulino.h"
2+
3+
ModulinoVibro vibro;
4+
5+
void setup() {
6+
Modulino.begin();
7+
vibro.begin();
8+
}
9+
10+
void loop() {
11+
vibro.on(1000);
12+
delay(1000);
13+
vibro.off();
14+
delay(1000);
15+
}

0 commit comments

Comments
 (0)