Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hddtempserial
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Oleg Nikulin
hddtempserial
Commits
9f34940f
Commit
9f34940f
authored
Jul 10, 2024
by
Oleg Nikulin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Режим отладки
parent
e6e9ea42
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
hddtempserial.ino
hddtempserial/hddtempserial.ino
+26
-1
No files found.
hddtempserial/hddtempserial.ino
View file @
9f34940f
...
...
@@ -2,7 +2,7 @@
#include "functions.h"
#define STANDALONE_MODE
#define STANDALONE_SERIAL_DEBUG
#define FAN_COUNT 6 //Количество вентиляторов
#define CONTROL_COUNT 3 //Количество групп управления
...
...
@@ -21,6 +21,8 @@
#define BEEP_STRENGTH 100 //Уровень ШИМ для пищалки. (При 255 не работает, нужно чтобы был именно ШИМ)
#define BLINK_INTERVAL 200 //Интервал мигания светодиода во время ожидания ответа от пк (мс)
#define DEBUG_INTERVAL 1000 //Интвервал отправки данных при STANDALONE_SERIAL_DEBUG
#define SOUND_PIN 10 //Номер пина пищалки
#define LED_PIN 13 //Номер пина светодиода
#define TEMP_SENSOR_PIN A7 //Номер пина датчика температуры
...
...
@@ -159,6 +161,10 @@ fan &fan_6 = fans[5];
uint32_t
last_beep_time
=
0
;
uint32_t
last_poll_time
=
0
;
uint32_t
lastRpmCheck
=
0
;
#if defined(STANDALONE_MODE) && defined(STANDALONE_SERIAL_DEBUG)
uint32_t
last_debug_time
=
0
;
#endif
//float p[3] = {};
//float i[3] = {};
...
...
@@ -536,6 +542,9 @@ void setup() {
control_c
.
max_duty_cycle
=
255
;
initialized
=
true
;
#ifdef STANDALONE_SERIAL_DEBUG
Serial
.
begin
(
BAUDRATE
);
#endif
#else
Serial
.
begin
(
BAUDRATE
);
#endif
...
...
@@ -567,6 +576,22 @@ void loop() {
}
}
#if defined(STANDALONE_MODE) && defined(STANDALONE_SERIAL_DEBUG)
if
(
uint32_t
(
millis
()
-
last_debug_time
)
>=
DEBUG_INTERVAL
)
{
Serial
.
print
(
"A target temp = "
);
Serial
.
print
(
control_a
.
target_temperature
);
Serial
.
print
(
" current temp = "
);
Serial
.
print
(
control_a
.
temperature
);
Serial
.
print
(
" duty cycle = "
);
Serial
.
print
(
control_a
.
dutyCycle
);
Serial
.
print
(
" i = "
);
Serial
.
print
(
errorIntegral
[
0
]);
Serial
.
println
();
last_debug_time
=
millis
();
}
#endif
#ifndef STANDALONE_MODE
if
(
pc_poll_interval_sec
!=
-
1
&&
uint32_t
(
millis
()
-
last_poll_time
)
>=
pc_poll_interval_sec
*
2
*
1000
)
{
pc_respond
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment