Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PaperBoat
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
Mel Avina-Beltran
PaperBoat
Commits
c3ed0ad8
There was an error fetching the commit references. Please try again later.
Commit
c3ed0ad8
authored
5 years ago
by
Mel Avina-Beltran
Browse files
Options
Downloads
Patches
Plain Diff
Upload Paperboat Arduino Code for servos
parent
72f3c850
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.DS_Store
+0
-0
0 additions, 0 deletions
.DS_Store
PaperBoat.ino
+40
-0
40 additions, 0 deletions
PaperBoat.ino
with
40 additions
and
0 deletions
.DS_Store
+
0
−
0
View file @
c3ed0ad8
No preview for this file type
This diff is collapsed.
Click to expand it.
PaperBoat.ino
0 → 100644
+
40
−
0
View file @
c3ed0ad8
#include
<WiFi.h>
/* wifi functionality */
#include
<Servo.h>
/* servo functionality */
const
char
*
ssid
=
"lemur"
;
/* network name */
const
char
*
password
=
"lemu"
/* network password */
const
int
SERVO_LEFT
=
D1
;
/* declaring right and left servos */
const
int
SERVO_RIGHT
=
D2
;
Servo
servo_left
;
Servo
servo_right
;
void
setup
()
{
Serial
.
begin
(
115200
);
/* serial montiro of Arduino IDE */
scanNetwork
();
/* scan available WiFi networks & print info about them*/
connectToNetwork
();
/* connect device to WiFi network*/
Serial
.
println
(
WiFi
.
localIP
());
/* ESP32 should have local IP, to get it, call localIP method of WiFi ectern variable */
Serial
.
println
(
WiFi
.
macAddress
());
/* call macAddress method on WiFi ectern variable */
WiFi
.
disconnect
(
true
);
/* pass value of true to disable WiFi */
Serial
.
println
(
WiFi
.
localIP
());
/* call method to get IP again to confirm disconnect from network and no IP assigned */
servosWakeUp
();
}
void
setup
()
{
/* code for boat servos (make a loop or command for it) */
servo_left
.
attach
(
SERVO_LEFT
);
servo_right
.
attach
(
SERVO_RIGHT
);
servo_left
.
write
(
0
);
servo_right
.
write
(
180
);
}
void
servosWakeUp
()
{
servo_left
.
attach
(
SERVO_LEFT
);
servo_right
.
attach
(
SERVO_RIGHT
);
servo_left
.
write
(
0
);
servo_right
.
write
(
180
);
}
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