Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SCPActuatorCoiling
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pooja Patel
SCPActuatorCoiling
Commits
3f8ddbdb
Commit
3f8ddbdb
authored
8 years ago
by
Ahmed Allibhoy
Browse files
Options
Downloads
Patches
Plain Diff
Added coiling code
parent
b677ec01
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main/coiling.ino/coiling.ino.ino
+49
-0
49 additions, 0 deletions
main/coiling.ino/coiling.ino.ino
with
49 additions
and
0 deletions
main/coiling.ino/coiling.ino.ino
0 → 100644
+
49
−
0
View file @
3f8ddbdb
#include
<Stepper.h>
const
int
stepsPerRevolution
=
200
;
// change this to fit the number of steps per revolution
const
int
rpm
=
200
;
// for your motor
const
int
PIN1
=
D1
;
const
int
PIN2
=
D2
;
const
int
PIN3
=
D3
;
const
int
PIN4
=
D4
;
// initialize the stepper library on pins 8 through 11:
Stepper
myStepper
(
stepsPerRevolution
,
PIN1
,
PIN2
,
PIN3
,
PIN4
);
int
stepCount
=
0
;
// number of steps the motor has taken
void
do_steps
(
int
num_steps
){
int
stepsPerSecond
=
stepsPerRevolution
/
(
60
*
rpm
);
//int run_
}
void
setup
()
{
wdt_disable
();
pinMode
(
PIN1
,
OUTPUT
);
pinMode
(
PIN2
,
OUTPUT
);
pinMode
(
PIN3
,
OUTPUT
);
pinMode
(
PIN4
,
OUTPUT
);
Serial
.
println
(
"asdfsdF"
);
myStepper
.
setSpeed
(
rpm
);
}
void
loop
()
{
// step 1/100 of a revolution:
int
numRevolutions
=
10
;
myStepper
.
step
(
numRevolutions
*
stepsPerRevolution
);
Serial
.
println
(
stepCount
);
delay
(
500
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
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