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
d597eaa9
Commit
d597eaa9
authored
5 years ago
by
Mel Avina-Beltran
Browse files
Options
Downloads
Patches
Plain Diff
Upload Arduino code for Web Server
parent
c3ed0ad8
Branches
Branches containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.DS_Store
+0
-0
0 additions, 0 deletions
.DS_Store
PaperBoat.ino
+20
-0
20 additions, 0 deletions
PaperBoat.ino
Test.h
+96
-0
96 additions, 0 deletions
Test.h
Test.ino
+51
-0
51 additions, 0 deletions
Test.ino
with
167 additions
and
0 deletions
.DS_Store
+
0
−
0
View file @
d597eaa9
No preview for this file type
This diff is collapsed.
Click to expand it.
PaperBoat.ino
+
20
−
0
View file @
d597eaa9
...
@@ -38,3 +38,23 @@ void servosWakeUp() {
...
@@ -38,3 +38,23 @@ void servosWakeUp() {
servo_left
.
write
(
0
);
servo_left
.
write
(
0
);
servo_right
.
write
(
180
);
servo_right
.
write
(
180
);
}
}
#include
<Servo.h>
static
const
int
SERVO
-
LEFT
=
D1
;
static
const
int
SERVO
-
RIGHT
=
D2
;
Servo
servo_left
;
Servo
servo_right
;
void
setup
()
{
Serial
.
begin
(
115200
);
servo_left
.
attach
(
SERVO
-
LEFT
);
servo_right
.
attach
(
SERVO
-
RIGHT
);
servoMove
();
}
void
servoMove
()
{
servo_left
.
write
(
0
);
servo_right
.
write
(
180
);
}
This diff is collapsed.
Click to expand it.
Test.h
0 → 100644
+
96
−
0
View file @
d597eaa9
const
char
MAIN_page
[]
PROGMEM
=
R
"=====(
<html>
<head>
<title>LEMUR Paper Boat</title>
<style>
h2 {
color: orange;
}
h3 {
color: #2274AF;
}
body {
background-color: black;
text-align: center;
color: white;
font-family: Arial, Helvetica, sans-serif;
}
.header{
padding: 20px;
text-align: center;
background: black;
color: white;
}
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button1 {
background-color: red;
}
table, th, td {
border: 1px solid black;
padding: 10px;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
}
</style>
</head>
<div class="
header
">
<h1>Paper Boat</h1>
</div>
<body>
<button class="
button
">ON</button>
<button class="
button
button1
">OFF</button>
<div class="
table
">
<table align="
center
">
<tr>
<th>↖</th>
<th>↑</th>
<th>↗</th>
</tr>
<tr>
<td>←</td>
<td><img src="
https
:
//s7d2.scene7.com/is/image/Fathead/lgo_ncaa_ucla_bruins?layer=comp&fit=constrain&hei=300&wid=300&fmt=png-alpha&qlt=95,0&op_sharpen=1&resMode=bicub&op_usm=0.0,0.0,0,0&iccEmbed=0" alt="bruin" style="width:200px"></td>
<
td
>&
#
8594
;
</
th
>
</
tr
>
<
tr
>
<
td
>&
#
8601
;
</
td
>
<
td
>&
#
8595
;
</
td
>
<
td
>&
#
8600
;
</
td
>
</
tr
>
</
table
>
</
div
>
<
div
class
=
"footer"
>
<
h2
>
LEMUR
</
h2
>
<
h4
>
The
Laboratory
of
Embedded
Machines
and
Ubiquitous
Robots
</
h4
>
<
h3
>
UCLA
Electrical
Engineering
</
h3
>
</
div
>
</
body
>
</
html
>
)
=====
";
This diff is collapsed.
Click to expand it.
Test.ino
0 → 100644
+
51
−
0
View file @
d597eaa9
#include
<ESP8266WiFi.h>
#include
<WiFiClient.h>
#include
<ESP8266WebServer.h>
#include
"PaperBoat.h"
//SSID and Password of your WiFi router
const
char
*
ssid
=
"Melissa's iPhone"
;
const
char
*
password
=
"yelloooo"
;
ESP8266WebServer
server
(
80
);
//Server on port 80
//===============================================================
// This routine is executed when you open its IP in browser
//===============================================================
void
handleRoot
()
{
String
s
=
MAIN_page
;
//Read HTML contents
server
.
send
(
200
,
"text/html"
,
s
);
//Send web page
}
//==============================================================
// SETUP
//==============================================================
void
setup
(
void
){
Serial
.
begin
(
9600
);
WiFi
.
begin
(
ssid
,
password
);
//Connect to your WiFi router
Serial
.
println
(
""
);
// Wait for connection
while
(
WiFi
.
status
()
!=
WL_CONNECTED
)
{
delay
(
500
);
Serial
.
print
(
"."
);
}
//If connection successful show IP address in serial monitor
Serial
.
println
(
""
);
Serial
.
print
(
"Connected to "
);
Serial
.
println
(
ssid
);
Serial
.
print
(
"IP address: "
);
Serial
.
println
(
WiFi
.
localIP
());
//IP address assigned to your ESP
server
.
on
(
"/"
,
handleRoot
);
//Which routine to handle at root location
server
.
begin
();
//Start server
Serial
.
println
(
"HTTP server started"
);
}
//==============================================================
// LOOP
//==============================================================
void
loop
(
void
){
server
.
handleClient
();
//Handle client requests
}
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