Skip to content

Commit c80a8da

Browse files
author
Zer0-bit
committed
- blackpill | + some admin
1 parent f35f1a7 commit c80a8da

6 files changed

+40
-50
lines changed

nextion-basic-lcd-dbg.tft

-3.68 MB
Binary file not shown.

nextion-discovery-lcd-dbg.tft

-1.62 MB
Binary file not shown.

platformio.ini

+20-33
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,38 @@
1010

1111
[platformio]
1212
default_envs = nano
13-
; src_dir = scales-calibration
14-
15-
[extra]
16-
lib_deps_external =
17-
seithan/Easy Nextion Library@^1.0.6
18-
adafruit/MAX6675 library@^1.1.0
19-
; adafruit/Adafruit MAX31855 library@^1.3.0
20-
https://github.com/banoz/PSM.Library.git
21-
https://github.com/banoz/HX711.git
22-
; https://github.com/lis0r/HX711.git#feature/twinboard
2313

2414
[env:nano]
2515
framework = arduino
2616
platform = atmelavr
2717
board = nanoatmega328
18+
extra_scripts =
19+
pre:scripts/custom-src-dir.py
20+
custom_src_dir = src
2821
lib_compat_mode = strict
2922
lib_deps =
23+
seithan/Easy Nextion Library@^1.0.6
24+
adafruit/MAX6675 library@^1.1.0
3025
khoih-prog/TimerInterrupt_Generic@^1.8.0
31-
${extra.lib_deps_external}
26+
https://github.com/banoz/PSM.Library.git
27+
https://github.com/banoz/HX711.git
28+
29+
build_flags =
30+
-DPIO_FRAMEWORK_ARDUINO_STANDARD_LIB
31+
-Wall
3232

3333
[env:nanonew]
34-
framework = arduino
35-
platform = atmelavr
34+
extends = env:nano
3635
board = nanoatmega328new
37-
lib_compat_mode = strict
38-
lib_deps =
39-
khoih-prog/TimerInterrupt_Generic@^1.8.0
40-
${extra.lib_deps_external}
4136

42-
[env:blackpill]
43-
framework = arduino
44-
platform = ststm32
45-
board = blackpill_f411ce
46-
upload_protocol = stlink
47-
debug_tool = stlink
48-
monitor_speed = 115200
49-
lib_deps =
50-
robtillaart/ADS1X15 @ 0.3.6
51-
khoih-prog/FlashStorage_STM32 @ ^1.2.0
52-
${extra.lib_deps_external}
53-
build_flags =
54-
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
55-
-D USBCON
56-
-D PIO_FRAMEWORK_ARDUINO_STANDARD_LIB
57-
-Wdouble-promotion
37+
[env:scales-calibration-nano]
38+
extends = env:nano
39+
custom_src_dir = scales-calibration
40+
41+
[env:scales-calibration-nanonew]
42+
extends = env:nano
43+
board = nanoatmega328new
44+
custom_src_dir = scales-calibration
5845

5946
[env:test]
6047
platform = native

scripts/custom-src-dir.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
3+
Import("env")
4+
5+
custom_src = env.GetProjectOption("custom_src_dir")
6+
full_path = os.path.join("$PROJECT_DIR", custom_src)
7+
8+
print("\nPROJECT SOURCE DIR: " + full_path)
9+
10+
env['PROJECT_SRC_DIR'] = full_path
11+
12+
# print(env.Dump())

make-sd.sh scripts/make-sd.sh

File renamed without changes.

src/gaggiuino.ino

+8-17
Original file line numberDiff line numberDiff line change
@@ -559,35 +559,26 @@ void justDoCoffee() {
559559
setBoiler(LOW);
560560
}
561561
} else { //if brewState == 0
562-
// USART_CH1.println("DO_COFFEE BREW BTN NOT ACTIVE BLOCK");
563-
//brewTimer(0);
564562
if (kProbeReadValue < ((float)setPoint - 10.00f)) {
565563
setBoiler(HIGH);
566-
} else if (kProbeReadValue >= ((float)setPoint - 10.00f) && kProbeReadValue < ((float)setPoint - 3.00f)) {
567-
setBoiler(HIGH);
568-
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider) {
569-
setBoiler(LOW);
570-
heaterState=false;
571-
heaterWave=millis();
572-
}
573-
} else if ((kProbeReadValue >= ((float)setPoint - 3.00f)) && (kProbeReadValue <= ((float)setPoint - 1.00f))) {
574-
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && !heaterState) {
564+
} else if (kProbeReadValue >= ((float)setPoint - 10.f) && kProbeReadValue < ((float)setPoint - 5.f)) {
565+
if (millis() - heaterWave > HPWR_OUT && !heaterState) {
575566
setBoiler(HIGH);
576567
heaterState=true;
577568
heaterWave=millis();
578-
} else if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && heaterState ) {
569+
} else if (millis() - heaterWave > HPWR_OUT / BrewCycleDivider && heaterState ) {
579570
setBoiler(LOW);
580571
heaterState=false;
581572
heaterWave=millis();
582573
}
583-
} else if ((kProbeReadValue >= ((float)setPoint - 0.5f)) && kProbeReadValue < (float)setPoint) {
584-
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && !heaterState ) {
574+
} else if ((kProbeReadValue >= ((float)setPoint - 5.f)) && (kProbeReadValue <= ((float)setPoint - 0.25f))) {
575+
if (millis() - heaterWave > HPWR_OUT * BrewCycleDivider && !heaterState) {
585576
setBoiler(HIGH);
586-
heaterState=true;
577+
heaterState=!heaterState;
587578
heaterWave=millis();
588-
} else if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && heaterState ) {
579+
} else if (millis() - heaterWave > HPWR_OUT / BrewCycleDivider && heaterState ) {
589580
setBoiler(LOW);
590-
heaterState=false;
581+
heaterState=!heaterState;
591582
heaterWave=millis();
592583
}
593584
} else {

0 commit comments

Comments
 (0)