Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openFire mini
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
RAJlab
openFire mini
Commits
d95ea834
Commit
d95ea834
authored
7 months ago
by
Ondřej Kučera
Browse files
Options
Downloads
Patches
Plain Diff
upgrade battery voltage reading function, update default and maximum delays
parent
7014cc2c
Branches
main
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FW/openFire-mini/openFire-mini.ino
+19
-18
19 additions, 18 deletions
FW/openFire-mini/openFire-mini.ino
FW/openFire-mini/web.h
+2
-2
2 additions, 2 deletions
FW/openFire-mini/web.h
with
21 additions
and
20 deletions
FW/openFire-mini/openFire-mini.ino
+
19
−
18
View file @
d95ea834
...
...
@@ -67,8 +67,8 @@ int firebuttonpresed = 0;
bool
blinkStatus
=
true
;
bool
armed
=
false
;
int
firedelay
=
2
;
// delay after pressing "Fire"
float
fireduration
=
1
;
// eFuse burn duration
int
firedelay
=
0
;
// delay after pressing "Fire"
float
fireduration
=
2
;
// eFuse burn duration
CRGB
leds
[
1
];
// addressable LED lib
int
Lspeed
=
1000
;
// LED blink speed
...
...
@@ -97,14 +97,16 @@ void setup() {
// addressable LED setup
FastLED
.
addLeds
<
WS2812B
,
NEOPIXEL_PIN
,
GRB
>
(
leds
,
1
);
FastLED
.
setBrightness
(
brightness
);
// // refuse to start if there is an eFuse already connected
// // sound the buzzer
// if (digitalRead(CH1_M) | digitalRead(CH2_M)){
// Serial.println("DISCONNECT ALL eFUSES BEFORE POWERING UP!");
// digitalWrite(BUZZER, HIGH);
// while (true);
// }
/*
// refuse to start if there is an eFuse already connected
// sound the buzzer
if (digitalRead(CH1_M) | digitalRead(CH2_M)){
Serial.println("DISCONNECT ALL eFUSES BEFORE POWERING UP!");
digitalWrite(BUZZER, HIGH);
while (true);
}
*/
// start-up beeps
digitalWrite
(
BUZZER
,
HIGH
);
...
...
@@ -175,7 +177,7 @@ void setup() {
void
loop
()
{
timer
.
tick
();
batterystatus
();
voltage
=
batterystatus
();
if
(
digitalRead
(
CH1_M
)){
ch1_fuse
=
1
;
...
...
@@ -309,13 +311,12 @@ bool ledBlinkOFF(void *){
}
void
batterystatus
(){
float
ADCmV
=
analogReadMilliVolts
(
MBATT
);
// read ADC
voltage
=
(
ADCmV
/
1000
);
// convert to volts
voltage
=
voltage
/
3.3
*
13.3
;
// calculate battery pack voltage
Serial
.
println
(
voltage
);
voltage
=
voltage
/
3
;
// calculate cell voltage
Serial
.
println
(
voltage
);
float
batterystatus
(){
float
_voltage
=
analogReadMilliVolts
(
MBATT
);
// read ADC [milivolts]
_voltage
=
(
_voltage
/
1000
);
// convert to volts
_voltage
=
_voltage
/
3.3
*
13.3
;
// calculate battery pack voltage
_voltage
=
_voltage
/
3
;
// calculate cell voltage
return
_voltage
;
}
// responses for HTTP GET requests from the web ui
...
...
This diff is collapsed.
Click to expand it.
FW/openFire-mini/web.h
+
2
−
2
View file @
d95ea834
...
...
@@ -326,11 +326,11 @@ const char* htmlContent = R"rawliteral(
<
h2
>
Settings
</
h2
>
<
label
for
=
"delay-slider"
>
Delay
:</
label
>
<
input
type
=
"range"
id
=
"delay-slider"
min
=
"0"
max
=
"
25
"
value
=
"
2
"
>
<
input
type
=
"range"
id
=
"delay-slider"
min
=
"0"
max
=
"
10
"
value
=
"
0
"
>
<
span
id
=
"delay-value"
>
5
s
</
span
>
<
label
for
=
"duration-slider"
>
Duration
:</
label
>
<
input
type
=
"range"
id
=
"duration-slider"
min
=
"0.
2
"
max
=
"
2
"
step
=
"0.2"
value
=
"
1
"
>
<
input
type
=
"range"
id
=
"duration-slider"
min
=
"0.
1
"
max
=
"
5
"
step
=
"0.2"
value
=
"
2
"
>
<
span
id
=
"duration-value"
>
10
s
</
span
>
<
label
for
=
"Brightness-slider"
>
LED
Brightness
</
label
>
...
...
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