Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dvfs-genomic-sequencing-smartpower2
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Sigurd Hagen Tullander
dvfs-genomic-sequencing-smartpower2
Commits
9f79ca81
Commit
9f79ca81
authored
7 years ago
by
SeungChul Lee
Browse files
Options
Downloads
Patches
Plain Diff
Fix indent
parent
2e4f5897
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/smartpower2.ino
+355
-348
355 additions, 348 deletions
src/smartpower2.ino
with
355 additions
and
348 deletions
src/smartpower2.ino
+
355
−
348
View file @
9f79ca81
...
@@ -71,7 +71,6 @@ WebSocketsServer webSocket = WebSocketsServer(81);
...
@@ -71,7 +71,6 @@ WebSocketsServer webSocket = WebSocketsServer(81);
IPAddress
ip
=
IPAddress
(
192
,
168
,
4
,
1
);
IPAddress
ip
=
IPAddress
(
192
,
168
,
4
,
1
);
SimpleTimer
timer
;
SimpleTimer
timer
;
SimpleTimer
timer2
;
// lcd slave address are 0x27 or 0x3f
// lcd slave address are 0x27 or 0x3f
LiquidCrystal_I2C
lcd
(
0x27
,
16
,
2
);
LiquidCrystal_I2C
lcd
(
0x27
,
16
,
2
);
...
@@ -100,6 +99,14 @@ void setup() {
...
@@ -100,6 +99,14 @@ void setup() {
delay
(
1000
);
delay
(
1000
);
}
}
USE_SERIAL
.
println
(
""
);
USE_SERIAL
.
println
(
"##############################"
);
USE_SERIAL
.
printf
(
"SmartPower2 v"
);
USE_SERIAL
.
print
(
FWversion
);
USE_SERIAL
.
println
(
" (Serial Interface)"
);
USE_SERIAL
.
println
(
"##############################"
);
USE_SERIAL
.
println
(
""
);
SPIFFS
.
begin
();
SPIFFS
.
begin
();
{
{
Dir
dir
=
SPIFFS
.
openDir
(
"/"
);
Dir
dir
=
SPIFFS
.
openDir
(
"/"
);
...
@@ -240,7 +247,10 @@ bool handleFileRead(String path) {
...
@@ -240,7 +247,10 @@ bool handleFileRead(String path) {
}
}
void
handleFileList
()
{
void
handleFileList
()
{
if
(
!
server
->
hasArg
(
"dir"
))
{
server
->
send
(
500
,
"text/plain"
,
"BAD ARGS"
);
return
;}
if
(
!
server
->
hasArg
(
"dir"
))
{
server
->
send
(
500
,
"text/plain"
,
"BAD ARGS"
);
return
;
}
String
path
=
server
->
arg
(
"dir"
);
String
path
=
server
->
arg
(
"dir"
);
Serial
.
println
(
"handleFileList: "
+
path
);
Serial
.
println
(
"handleFileList: "
+
path
);
Dir
dir
=
SPIFFS
.
openDir
(
path
);
Dir
dir
=
SPIFFS
.
openDir
(
path
);
...
@@ -265,7 +275,7 @@ void handleFileList() {
...
@@ -265,7 +275,7 @@ void handleFileList() {
void
handleClientData
(
uint8_t
num
,
String
data
)
void
handleClientData
(
uint8_t
num
,
String
data
)
{
{
Serial
.
println
(
data
);
//
Serial.println(data);
switch
(
data
.
charAt
(
0
))
{
switch
(
data
.
charAt
(
0
))
{
case
PAGE_STATE
:
case
PAGE_STATE
:
client_sp2
[
num
].
page
=
data
.
charAt
(
1
)
-
48
;
client_sp2
[
num
].
page
=
data
.
charAt
(
1
)
-
48
;
...
@@ -727,9 +737,6 @@ void handler(void)
...
@@ -727,9 +737,6 @@ void handler(void)
{
{
if
(
onoff
==
ON
)
{
if
(
onoff
==
ON
)
{
digitalWrite
(
POWERLED
,
D1state
=
!
D1state
);
digitalWrite
(
POWERLED
,
D1state
=
!
D1state
);
if
(
connectedLCD
||
connectedWeb
||
logClient
)
{
readPower
();
}
}
}
if
(
connectedLCD
)
{
if
(
connectedLCD
)
{
...
...
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