Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions firmware/nixieClock_2_v1.6/0_data.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ boolean currentDigit = false;
int8_t changeHrs, changeMins;
boolean lampState = false;
boolean anodeStates[] = {1, 1, 1, 1};
boolean started = false;

const uint8_t CRTgamma[256] PROGMEM = {
0, 0, 1, 1, 1, 1, 1, 1,
Expand Down
4 changes: 3 additions & 1 deletion firmware/nixieClock_2_v1.6/1_setup.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
void setup() {
//Serial.begin(9600);
// Serial.begin(9600);
// случайное зерно для генератора случайных чисел
randomSeed(analogRead(6) + analogRead(7));

Expand Down Expand Up @@ -44,10 +44,12 @@ void setup() {
EEPROM.put(0, FLIP_EFFECT);
EEPROM.put(1, BACKL_MODE);
EEPROM.put(2, GLITCH_ALLOWED);
EEPROM.put(3, DOT_MODE);
}
EEPROM.get(0, FLIP_EFFECT);
EEPROM.get(1, BACKL_MODE);
EEPROM.get(2, GLITCH_ALLOWED);
EEPROM.get(3, DOT_MODE);

/*if (EEPROM.read(100) != 66) { // проверка на первый запуск. 66 от балды
EEPROM.write(100, 66);
Expand Down
8 changes: 7 additions & 1 deletion firmware/nixieClock_2_v1.6/2_loop.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
void loop() {
if (dotTimer.isReady()) calculateTime(); // каждые 500 мс пересчёт и отправка времени
if (dotTimer.isReady()) {
calculateTime(); // каждые 500 мс пересчёт и отправка времени
if (!started) {
burnIndicators();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше сделать это при инициализации в setup.ino, чтобы каждый раз не проверялось условие, которое заведомо выполняется единожды.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это была моя первая идея, но на этот момент лампы ещё не успевают зажечься, поэтому особой пользы не будет

started = true;
}
}
if (newTimeFlag && curMode == 0) flipTick(); // перелистывание цифр
dotBrightTick(); // плавное мигание точки
backlBrightTick(); // плавное мигание подсветки ламп
Expand Down
4 changes: 3 additions & 1 deletion firmware/nixieClock_2_v1.6/bright.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ void dotBrightTick() {
dotBrightCounter = 0;
}
}
if (dotBrightCounter > 0) {
if (DOT_MODE == 0) {
setPWM(DOT, dotBrightCounter);
} else if (DOT_MODE == 1 && dotBrightCounter > 0) {
setPWM(DOT, getPWM_CRT(dotBrightCounter));
}
}
Expand Down
6 changes: 6 additions & 0 deletions firmware/nixieClock_2_v1.6/buttonsSettings.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ void buttonsTick() {
EEPROM.put(1, BACKL_MODE);
}

// переключение мигания точки
if (btnR.isHolded()) {
if (++DOT_MODE >= 2) DOT_MODE = 0;
EEPROM.put(3, DOT_MODE);
}

// переключение глюков
if (btnL.isHolded()) {
GLITCH_ALLOWED = !GLITCH_ALLOWED;
Expand Down
5 changes: 5 additions & 0 deletions firmware/nixieClock_2_v1.6/nixieClock_2_v1.6.ino
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ byte BACKL_MODE = 0;
// 1 - постоянный свет
// 2 - выключена

// эффекты мигания
byte DOT_MODE = 0;
// 0 - мигание с плавным угасанием
// 1 - обычное мигание

// ======================= ЯРКОСТЬ =======================
#define NIGHT_LIGHT 1 // менять яркость от времени суток (1 вкл, 0 выкл)
#define NIGHT_START 23 // час перехода на ночную подсветку (BRIGHT_N)
Expand Down