Skip to content

Commit

Permalink
Add info about configuration to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lo1ol committed Dec 27, 2024
1 parent be0e24d commit 9d9c4af
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DarkroomTimer/src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#define DISPLAY_ROWS 2
#define DISPLAY_COLS 16

#define MAX_BACKLIGHT 250
#define MAX_BACKLIGHT 25

static_assert(MAX_BACKLIGHT % 10 == 0);
static_assert(MAX_BACKLIGHT <= 25);
2 changes: 1 addition & 1 deletion DarkroomTimer/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Settings::Settings() {
if (hash != storedHash) {
lagTime = 0_ts;
beepVolume = 3 * 3;
backlight = (3 * MAX_BACKLIGHT) / 10;
backlight = 3 * MAX_BACKLIGHT;
autoFinishViewMinutes = 3;
startWithSettings = false;
melody = Melody::nice;
Expand Down
4 changes: 2 additions & 2 deletions DarkroomTimer/src/SettingsSetter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ void SettingsSetter::processSetAutoFinishView() const {

void SettingsSetter::processSetBacklight() const {
gDisplay[0] << "Backlight";
uint8_t userBacklight = min(gSettings.backlight, MAX_BACKLIGHT) / (MAX_BACKLIGHT / 10);
uint8_t userBacklight = min(gSettings.backlight, MAX_BACKLIGHT * 10) / MAX_BACKLIGHT;
getInt(userBacklight, 1, 10);
gSettings.backlight = userBacklight * (MAX_BACKLIGHT / 10);
gSettings.backlight = userBacklight * MAX_BACKLIGHT;
gDisplay[1] << userBacklight;
analogWrite(BACKLIGHT, gSettings.backlight);
}
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ pio run -t build
pio run -t upload
```

### Firmware configuration

You can configure the firmware by your needs. For this, you have to change macroses in [Config.h](DarkroomTimer/src/Config.h) file:
* `LCD_*` -- pin and arduino to `*` pin on display
* `MODE_SWITCH_BTN` -- pin to mode button
* `VIEW_BTN` -- pin to view button
* `START_BTN` -- pin to start button
* `EXTRA_BTN` -- pin to button on encoder
* `ENCODER_DT` -- pin to DT(S1) pin on encoder (UNRECOMMENDED TO CHANGE)
* `ENCODER_CLK` -- pin to CLK(S2) pin on encoder (UNRECOMMENDED TO CHANGE)
* `BEEPER` -- pin to buzzer (UNRECOMMENDED TO CHANGE)
* `BACKLIGHT` -- pin to backlight control pin on display (marked as `A` on display)
* `RELAY` -- pin to SSR
* `MAX_BACKLIGHT` -- maximum backlight value (maximum value is 25)

> NB: Swapping of ENCODER_DT with ENCODER_CLK change direction of encoder
## Support

If you have any questions, problems or suggestions, you are welcome to write me:)
Expand Down
17 changes: 17 additions & 0 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,23 @@ pio run -t build
pio run -t upload
```

### Конфигурирование прошивки

You can configure the firmware by your needs. For this, you have to change macroses in [Config.h](DarkroomTimer/src/Config.h) file:
* `LCD_*` -- пин до `*` пина на дисплее
* `MODE_SWITCH_BTN` -- пин до кнопки смены режима
* `VIEW_BTN` -- пин до кнопки просмотра
* `START_BTN` -- пин до кнопки старта
* `EXTRA_BTN` -- пин до кнопки на энкодере
* `ENCODER_DT` -- пин до пина DT(S1) на энкодере (МЕНЯТЬ НЕ РЕКОМЕНДУЕТСЯ)
* `ENCODER_CLK` -- пин до пина CLK(S2) на энкодере (МЕНЯТЬ НЕ РЕКОМЕНДУЕТСЯ)
* `BEEPER` -- пин до зумера (МЕНЯТЬ НЕ РЕКОМЕНДУЕТСЯ)
* `BACKLIGHT` -- пин до пина регулировки подсветки на дисплее (помечен как `A` на дисплее)
* `RELAY` -- пин до твердотельного реле
* `MAX_BACKLIGHT` -- максимальное значение яркости (максимальное значение 25)

> NB: смена пина ENCODER_DT на ENCODER_CLK меняет направление энкодера
## Поддержка

Если есть вопросы, проблемы и предложения, то можете писать мне:
Expand Down

0 comments on commit 9d9c4af

Please sign in to comment.