Skip to content

Commit

Permalink
- blackpill | + some admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0-bit committed Sep 14, 2022
1 parent f35f1a7 commit c80a8da
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 50 deletions.
Binary file removed nextion-basic-lcd-dbg.tft
Binary file not shown.
Binary file removed nextion-discovery-lcd-dbg.tft
Binary file not shown.
53 changes: 20 additions & 33 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,38 @@

[platformio]
default_envs = nano
; src_dir = scales-calibration

[extra]
lib_deps_external =
seithan/Easy Nextion Library@^1.0.6
adafruit/MAX6675 library@^1.1.0
; adafruit/Adafruit MAX31855 library@^1.3.0
https://github.com/banoz/PSM.Library.git
https://github.com/banoz/HX711.git
; https://github.com/lis0r/HX711.git#feature/twinboard

[env:nano]
framework = arduino
platform = atmelavr
board = nanoatmega328
extra_scripts =
pre:scripts/custom-src-dir.py
custom_src_dir = src
lib_compat_mode = strict
lib_deps =
seithan/Easy Nextion Library@^1.0.6
adafruit/MAX6675 library@^1.1.0
khoih-prog/TimerInterrupt_Generic@^1.8.0
${extra.lib_deps_external}
https://github.com/banoz/PSM.Library.git
https://github.com/banoz/HX711.git

build_flags =
-DPIO_FRAMEWORK_ARDUINO_STANDARD_LIB
-Wall

[env:nanonew]
framework = arduino
platform = atmelavr
extends = env:nano
board = nanoatmega328new
lib_compat_mode = strict
lib_deps =
khoih-prog/TimerInterrupt_Generic@^1.8.0
${extra.lib_deps_external}

[env:blackpill]
framework = arduino
platform = ststm32
board = blackpill_f411ce
upload_protocol = stlink
debug_tool = stlink
monitor_speed = 115200
lib_deps =
robtillaart/ADS1X15 @ 0.3.6
khoih-prog/FlashStorage_STM32 @ ^1.2.0
${extra.lib_deps_external}
build_flags =
-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
-D USBCON
-D PIO_FRAMEWORK_ARDUINO_STANDARD_LIB
-Wdouble-promotion
[env:scales-calibration-nano]
extends = env:nano
custom_src_dir = scales-calibration

[env:scales-calibration-nanonew]
extends = env:nano
board = nanoatmega328new
custom_src_dir = scales-calibration

[env:test]
platform = native
Expand Down
12 changes: 12 additions & 0 deletions scripts/custom-src-dir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os

Import("env")

custom_src = env.GetProjectOption("custom_src_dir")
full_path = os.path.join("$PROJECT_DIR", custom_src)

print("\nPROJECT SOURCE DIR: " + full_path)

env['PROJECT_SRC_DIR'] = full_path

# print(env.Dump())
0 make-sd.sh → scripts/make-sd.sh
100755 → 100644
File renamed without changes.
25 changes: 8 additions & 17 deletions src/gaggiuino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -559,35 +559,26 @@ void justDoCoffee() {
setBoiler(LOW);
}
} else { //if brewState == 0
// USART_CH1.println("DO_COFFEE BREW BTN NOT ACTIVE BLOCK");
//brewTimer(0);
if (kProbeReadValue < ((float)setPoint - 10.00f)) {
setBoiler(HIGH);
} else if (kProbeReadValue >= ((float)setPoint - 10.00f) && kProbeReadValue < ((float)setPoint - 3.00f)) {
setBoiler(HIGH);
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider) {
setBoiler(LOW);
heaterState=false;
heaterWave=millis();
}
} else if ((kProbeReadValue >= ((float)setPoint - 3.00f)) && (kProbeReadValue <= ((float)setPoint - 1.00f))) {
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && !heaterState) {
} else if (kProbeReadValue >= ((float)setPoint - 10.f) && kProbeReadValue < ((float)setPoint - 5.f)) {
if (millis() - heaterWave > HPWR_OUT && !heaterState) {
setBoiler(HIGH);
heaterState=true;
heaterWave=millis();
} else if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && heaterState ) {
} else if (millis() - heaterWave > HPWR_OUT / BrewCycleDivider && heaterState ) {
setBoiler(LOW);
heaterState=false;
heaterWave=millis();
}
} else if ((kProbeReadValue >= ((float)setPoint - 0.5f)) && kProbeReadValue < (float)setPoint) {
if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && !heaterState ) {
} else if ((kProbeReadValue >= ((float)setPoint - 5.f)) && (kProbeReadValue <= ((float)setPoint - 0.25f))) {
if (millis() - heaterWave > HPWR_OUT * BrewCycleDivider && !heaterState) {
setBoiler(HIGH);
heaterState=true;
heaterState=!heaterState;
heaterWave=millis();
} else if (millis() - heaterWave > HPWR_OUT/BrewCycleDivider && heaterState ) {
} else if (millis() - heaterWave > HPWR_OUT / BrewCycleDivider && heaterState ) {
setBoiler(LOW);
heaterState=false;
heaterState=!heaterState;
heaterWave=millis();
}
} else {
Expand Down

0 comments on commit c80a8da

Please sign in to comment.