-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestShoe.ino
More file actions
39 lines (35 loc) · 745 Bytes
/
testShoe.ino
File metadata and controls
39 lines (35 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const int analogInPin = A9;
int sensorValue = 0;
void setup() {
Serial.begin(9600);
pinMode(9, INPUT_PULLUP);
pinMode(12, INPUT);
pinMode(10, OUTPUT);
}
void loop() {
// digitalWrite(10, HIGH);
sensorValue = analogRead(analogInPin);
// Serial.println(sensorValue);
int a = analogRead(A11);
Serial.println(a);
if (sensorValue < 45) {
int a = analogRead(A11);
Serial.println(a);
vibrate(a);
}
}
void vibrate(int value) {
// digitalWrite(10, HIGH);
if (value < 60 && value > 10) {
digitalWrite(10, HIGH);
delay(400);
digitalWrite(10, LOW);
delay(250);
}
else if (value>60 && value<120) {
digitalWrite(10, HIGH);
delay(200);
digitalWrite(10, LOW);
delay(300);
}
}