-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStep.ino
54 lines (53 loc) · 1.11 KB
/
Step.ino
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
void step_size()
{
stepState = digitalRead(stepPin);
if (stepState != laststepState)
{
if (stepState == LOW)
stepPushCounter++;
Serial.println(freq_step);
laststepState = stepState;
}
if (stepPushCounter == 0)
{
freq_step = 1000000;
lcd.setCursor(15, 0);
lcd.print(" ");
lcd.setCursor(17, 0);
lcd.print("10M");
}
else if (stepPushCounter == 1)
{
freq_step = 100000;
lcd.setCursor(15, 0);
lcd.print(" ");
lcd.setCursor(17, 0);
lcd.print(" 1M");
}
else if (stepPushCounter == 2)
{
freq_step = 10000;
lcd.setCursor(15, 0);
lcd.print(" ");
lcd.setCursor(16, 0);
lcd.print("100k");
}
else if (stepPushCounter == 3)
{
freq_step = 1000;
lcd.setCursor(15, 0);
lcd.print(" ");
lcd.setCursor(17, 0);
lcd.print("10K");
}
else if (stepPushCounter == 4)
{
freq_step = 625;
lcd.setCursor(15, 0);
lcd.print(" ");
lcd.setCursor(15, 0);
lcd.print("6.25K");
}
else if (stepPushCounter == 5)
stepPushCounter = 0; //reset the counter to 0
}