Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geku
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
42loop
geku
Commits
6607ec5d
Commit
6607ec5d
authored
4 years ago
by
42loop
Browse files
Options
Downloads
Patches
Plain Diff
some cleanup
parent
ff470b55
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
geku_teensy.ino
+0
-19
0 additions, 19 deletions
geku_teensy.ino
initpins.ino
+7
-16
7 additions, 16 deletions
initpins.ino
motor_out.ino
+49
-53
49 additions, 53 deletions
motor_out.ino
with
56 additions
and
88 deletions
geku_teensy.ino
+
0
−
19
View file @
6607ec5d
...
...
@@ -63,25 +63,6 @@ Serial.println();
}
bool
waitready
()
{
bool
servoready
=
true
;
for
(
int
ax
=
0
;
ax
<
max_ax
;
ax
++
)
{
if
(
!
machineready
[
ax
])
{
servoready
=
false
;
Serial
.
print
(
"Servo "
);
Serial
.
print
(
ax
);
Serial
.
println
(
" not ready !"
);
}
}
return
servoready
;
}
void
setup
()
{
...
...
This diff is collapsed.
Click to expand it.
initpins.ino
+
7
−
16
View file @
6607ec5d
void
initpins
()
{
//ltc DA-converter
pinMode
(
ltc_clk
,
OUTPUT
);
pinMode
(
ltc_data
,
OUTPUT
);
pinMode
(
ltc_load
,
OUTPUT
);
...
...
@@ -16,7 +16,7 @@ digitalWrite(mux_a2,LOW);
digitalWrite
(
ltc_clk
,
LOW
);
digitalWrite
(
ltc_load
,
HIGH
);
//inverter start plus direction
pinMode
(
startXP
,
OUTPUT
);
pinMode
(
startYP
,
OUTPUT
);
pinMode
(
startZP
,
OUTPUT
);
...
...
@@ -25,6 +25,7 @@ digitalWrite(startXP,LOW);
digitalWrite
(
startYP
,
LOW
);
digitalWrite
(
startZP
,
LOW
);
//inverter start minus direction
pinMode
(
startXM
,
OUTPUT
);
pinMode
(
startYM
,
OUTPUT
);
pinMode
(
startZM
,
OUTPUT
);
...
...
@@ -33,6 +34,7 @@ digitalWrite(startXM,LOW);
digitalWrite
(
startYM
,
LOW
);
digitalWrite
(
startZM
,
LOW
);
//brake outputs
pinMode
(
brakeX
,
OUTPUT
);
pinMode
(
brakeY
,
OUTPUT
);
pinMode
(
brakeZ
,
OUTPUT
);
...
...
@@ -41,7 +43,7 @@ digitalWrite(brakeX,LOW);
digitalWrite
(
brakeY
,
LOW
);
digitalWrite
(
brakeZ
,
LOW
);
//limit and ref inputs
pinMode
(
limitXPpin
,
INPUT
);
pinMode
(
limitXMpin
,
INPUT
);
pinMode
(
limitYPpin
,
INPUT
);
...
...
@@ -52,12 +54,6 @@ pinMode(refX,INPUT);
pinMode
(
refY
,
INPUT
);
pinMode
(
refZ
,
INPUT
);
/*
pinMode(readyXpin,INPUT);
pinMode(readyYpin,INPUT);
pinMode(readyZpin,INPUT);
*/
digitalWrite
(
limitXPpin
,
HIGH
);
digitalWrite
(
limitXMpin
,
HIGH
);
...
...
@@ -69,13 +65,8 @@ digitalWrite(limitZMpin,HIGH);
digitalWrite
(
refX
,
HIGH
);
digitalWrite
(
refY
,
HIGH
);
digitalWrite
(
refZ
,
HIGH
);
/*
digitalWrite(readyXpin,HIGH);
digitalWrite(readyYpin,HIGH);
digitalWrite(readyZpin,HIGH);
*/
pinMode
(
led
,
OUTPUT
);
pinMode
(
led
,
OUTPUT
);
digitalWrite
(
led
,
HIGH
);
}
This diff is collapsed.
Click to expand it.
motor_out.ino
+
49
−
53
View file @
6607ec5d
...
...
@@ -3,13 +3,12 @@
void
set_motors
()
{
byte
currentmotor
=
0
;
//Serial.print("setltc: ");Serial.println(speed[0]);
for
(
currentmotor
=
0
;
currentmotor
<
max_ax
;
currentmotor
++
)
{
unsigned
int
val
;
//
inver
t values:
//
adap
t values:
former 0 was max minus speed, null_speed was stop, 4095 was max plus speed
if
(
speed
[
currentmotor
]
>
null_speed
)
//plus
{
val
=
speed
[
currentmotor
]
-
null_speed
;
...
...
@@ -39,15 +38,12 @@ if ((currentmotor & 2) !=0) digitalWrite(mux_a1,HIGH); else digitalWrite(mux_a1,
digitalWrite
(
mux_a2
,
LOW
);
for
(
int
i
=
12
;
i
>
0
;
i
--
)
{
if
((
val
&
(
1
<<
(
i
-
1
)))
>
0
)
{
if
((
val
&
(
1
<<
(
i
-
1
)))
>
0
)
digitalWrite
(
ltc_data
,
HIGH
);
}
else
{
else
digitalWrite
(
ltc_data
,
LOW
);
}
delayMicroseconds
(
1
);
digitalWrite
(
ltc_clk
,
HIGH
);
delayMicroseconds
(
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment