-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample_Epson_Program.prg
More file actions
73 lines (57 loc) · 1.75 KB
/
Example_Epson_Program.prg
File metadata and controls
73 lines (57 loc) · 1.75 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Function main 'starts a new function, or group of program statements'
'Program written by Anthony David'
'ME324L Lab Technician'
'Iowa State University, Mechanical Engineering Department, Ames, IA'
'Program written on 8/24/2021'
'For demonstration purposes'
Motor On 'Turns on robot power - two options; on and off'
Power High 'sets robot power mode - two options; high and low'
Speed 100 'sets robot speed - number is in percent; 0% to 100%'
Integer cnt 'creates a new variable - Can be names, single letters, and numbers'
Do Until cnt = 2 'This is the start of the "Do...Loop" statement'
'Syntax - Do[{While|Until} condition]'
'IMPORTANT - at the end of the section you want to loop, type "Loop"'
cnt = 0 'Gives our previoulsy defined variable a value'
Integer i
Home 'The home commands puts the robot in the starting "home" position'
For i = 0 To 1 'This is another way to loop your section(s) of code'
Go P0 'The "Go" statement tells the robot to move to the desired position P#'
Wait 0.25 'The "Wait" command tells the robot to hold its current position for the desired time - number is in seconds'
Go down 'You can also give the points names, and in your code, you can call these names out instead of typing P#'
Wait 0.25
Go P0
Wait 0.25
Home
Wait 0.25
Go P2
Wait 0.25
Home
Wait 0.25
Go P3
Wait 0.25
Go P4
Wait 0.25
Go P3
Wait 0.25
Next 'goes back up to the For statement and checks if the conditions have been met'
Home
Integer u
For u = 0 To 1
Go P5
Wait 0.25
Go P6
Wait 0.25
Go P5
Wait 0.25
Go P7
Wait 0.25
Go P8
Wait 0.25
Go P7
Wait 0.25
Next
Home
cnt = cnt + 1
Loop 'This is needed to complete the "Do...Loop" statement'
Motor Off
Fend 'ends the function, or group of program statements'