@Z.Lenar78, Не та версия библиотеки микролед. Нужна та, что была в архиве проекта. Если ее там нет, то пробуйте 1-ую.
Любое обновление этой библиотеки порушит компиляцию.
Любое обновление этой библиотеки порушит компиляцию.
In file included from E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:28:0:
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:7:17: error: 'PIN_PD4' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:20: note: in expansion of macro 'P_ENC_A'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:7:17: note: suggested alternative: 'PIN_A4'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:20: note: in expansion of macro 'P_ENC_A'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:8:17: error: 'PIN_PD5' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:29: note: in expansion of macro 'P_ENC_B'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:8:17: note: suggested alternative: 'PIN_A5'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:29: note: in expansion of macro 'P_ENC_B'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:9:17: error: 'PIN_PD6' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:38: note: in expansion of macro 'P_BTN'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:9:17: note: suggested alternative: 'PIND6'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:38: note: in expansion of macro 'P_BTN'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:43: error: template argument 2 is invalid
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:43: error: template argument 3 is invalid
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:32:43: error: template argument 4 is invalid
In file included from E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:28:0:
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:29:17: error: 'PIN_PB4' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:25: note: in expansion of macro 'P_G4'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:29:17: note: suggested alternative: 'PIN_A4'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:25: note: in expansion of macro 'P_G4'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:28:17: error: 'PIN_PB0' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:31: note: in expansion of macro 'P_G3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:28:17: note: suggested alternative: 'PINB0'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:31: note: in expansion of macro 'P_G3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:27:17: error: 'PIN_PD1' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:37: note: in expansion of macro 'P_G2'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:27:17: note: suggested alternative: 'PIND1'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:37: note: in expansion of macro 'P_G2'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:26:17: error: 'PIN_PD0' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:43: note: in expansion of macro 'P_G1'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:26:17: note: suggested alternative: 'PIND0'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:40:43: note: in expansion of macro 'P_G1'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:17:17: error: 'PIN_PD7' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:25: note: in expansion of macro 'P_SSA'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:17:17: note: suggested alternative: 'PIN_A7'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:25: note: in expansion of macro 'P_SSA'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:18:17: error: 'PIN_PC0' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:32: note: in expansion of macro 'P_SSB'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:18:17: note: suggested alternative: 'PINC0'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:32: note: in expansion of macro 'P_SSB'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:19:17: error: 'PIN_PC1' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:39: note: in expansion of macro 'P_SSC'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:19:17: note: suggested alternative: 'PINC1'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:39: note: in expansion of macro 'P_SSC'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:20:17: error: 'PIN_PC2' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:46: note: in expansion of macro 'P_SSD'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:20:17: note: suggested alternative: 'PINC2'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:46: note: in expansion of macro 'P_SSD'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:21:17: error: 'PIN_PC3' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:53: note: in expansion of macro 'P_SSE'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:21:17: note: suggested alternative: 'PIN_A3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:53: note: in expansion of macro 'P_SSE'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:22:17: error: 'PIN_PC4' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:60: note: in expansion of macro 'P_SSF'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:22:17: note: suggested alternative: 'PIN_A4'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:60: note: in expansion of macro 'P_SSF'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:23:17: error: 'PIN_PC5' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:67: note: in expansion of macro 'P_SSG'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:23:17: note: suggested alternative: 'PIN_A5'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:41:67: note: in expansion of macro 'P_SSG'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:12:17: error: 'PIN_PD3' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:26: note: in expansion of macro 'P_LED_R'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:12:17: note: suggested alternative: 'PIN_A3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:26: note: in expansion of macro 'P_LED_R'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:13:17: error: 'PIN_PB1' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:35: note: in expansion of macro 'P_LED_G'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:13:17: note: suggested alternative: 'PINB1'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:35: note: in expansion of macro 'P_LED_G'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:14:17: error: 'PIN_PB2' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:44: note: in expansion of macro 'P_LED_B'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:14:17: note: suggested alternative: 'PINB2'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:46:44: note: in expansion of macro 'P_LED_B'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino: In function 'void setup()':
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:3:17: error: 'PIN_PB3' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:81:11: note: in expansion of macro 'P_FAN'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:3:17: note: suggested alternative: 'PIN_A3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:81:11: note: in expansion of macro 'P_FAN'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino: In function 'void loop()':
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:100:11: error: request for member 'tick' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:102:13: error: request for member 'click' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:105:13: error: request for member 'held' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:111:13: error: request for member 'turn' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:112:21: error: request for member 'getDir' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:113:15: error: request for member 'fast' in 'enc', which is of non-class type 'int'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:127:9: error: request for member 'resetState' in 'enc', which is of non-class type 'int'
In file included from E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:28:0:
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino: In function 'void coolingTick()':
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:3:17: error: 'PIN_PB3' was not declared in this scope
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:142:17: note: in expansion of macro 'P_FAN'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\pinMap.h:3:17: note: suggested alternative: 'PIN_A3'
E:\постеры\RGBspot-main\RGBspot-main\firmware\RGBspot\RGBspot.ino:142:17: note: in expansion of macro 'P_FAN'
exit status 1
Compilation error: 'PIN_PD4' was not declared in this scope
Вот, пожалуйстаЗдравствуйте, скиньте файл скетч а, так будет проще решить ваш вопрос.
// ИК, вентилятор, термистор
#define P_IR 2
#define P_FAN 11
#define P_NTC 6
// энкодер
#define P_ENC_A 4
#define P_ENC_B 5
#define P_BTN 6
// светодиод
#define P_LED_R 3
#define P_LED_G 9
#define P_LED_B 10
// сегменты
#define P_SSA 7
#define P_SSB A0
#define P_SSC A1
#define P_SSD A2
#define P_SSE A3
#define P_SSF A4
#define P_SSG A5
// DIGи
#define P_G1 0
#define P_G2 1
#define P_G3 8
#define P_G4 12
// энкодер
#include <EncButton.h>
EncButton< EB_TICK, P_ENC_A, P_ENC_B, P_BTN> enc(INPUT);
// термистор
#include <GyverNTC.h>
GyverNTC therm(P_NTC, 10000, 3950);
// дисплей
#include "SevSeg.h"
const uint8_t digs[] = {P_G4, P_G3, P_G2, P_G1};
const uint8_t segs[] = {P_SSA, P_SSB, P_SSC, P_SSD, P_SSE, P_SSF, P_SSG};
SevSeg< 4, SS_CATHODE> disp(digs, segs);
// светодиод
#include <GRGB.h>
GRGB led(COMMON_CATHODE, P_LED_R, P_LED_G, P_LED_B);
// настройки для eeprom
struct Settings {
uint8_t mode = 0; // 0 hue, 1 kelvin
uint8_t hue = 0; // цвет
uint8_t hueB = 0; // яркость при цвете
uint8_t temp = 0; // температура
uint8_t tempB = 0; // яркость при температуре
};
Settings settings;
// менеджер eeprom
#include <EEManager.h>
EEManager memory(settings, 10000); // 10 сек
void setup() {
pinMode(P_FAN, OUTPUT);
// запуск епром с адреса 0, ключ 2 (любой 0-255)
// https://github.com/GyverLibs/EEManager
memory.begin(0, 2);
// принудительно обновляем
updateLED();
updateDisp();
}
// режим настройки
byte dispMode = 0; // 0 color, 1 bright
void loop() {
memory.tick(); // менеджер епром
disp.tick(); // динамо дисплея
coolingTick(); // регулирование вентилятора
if (enc.tick()) { // опрос, если было событие
// по клику меняем режим вывода
if (enc.click()) dispMode = !dispMode;
// по удержанию меняем режим настройки величина/яркость
if (enc.held()) {
settings.mode = !settings.mode;
dispMode = 0;
}
// поворот - меняем величину
if (enc.turn()) {
int val = enc.getDir(); // направление поворота
if (enc.fast()) val *= 5; // быстрый поворот - в 5 раз быстрее
if (dispMode) {
if (!settings.mode) settings.hueB += val;
else settings.tempB += val;
} else {
if (!settings.mode) settings.hue += val;
else settings.temp += val;
}
}
// обновляем
updateLED();
updateDisp();
enc.resetState(); // сбрасываем флаги (очищаем остальные события)
memory.update(); // откладываем обновление епром
}
}
void coolingTick() {
// таймер на 1 сек
static uint32_t tmr;
if (millis() - tmr >= 1000) {
tmr = millis();
static float temp = 25; // фильтрованная температура
temp += (therm.getTemp() - temp) * 0.2; // фильтр
// линейное регулирование
int duty = map(int(temp), 30, 45, 10, 255);
duty = constrain(duty, 10, 255);
analogWrite(P_FAN, duty);
}
}
void updateDisp() {
// буквы http://www.uize.com/examples/seven-segment-display.html
disp.clear();
if (!settings.mode) { // hue
if (dispMode) {
disp.setOneByte(3, 0x1f);
disp.setInt(settings.hueB);
} else {
disp.setOneByte(3, 0x17);
disp.setInt(settings.hue);
}
} else { // temp
if (dispMode) {
disp.setOneByte(3, 0x1f);
disp.setInt(settings.tempB);
} else {
disp.setOneByte(3, 0x0f);
disp.setInt(settings.temp);
}
}
}
void updateLED() {
// setWheel принимает 0-1530, у нас 8 бит - умножаем на 6 (1530 == 255 * 6)
if (!settings.mode) led.setWheel(settings.hue * 6, settings.hueB);
else led.setKelvin(settings.temp * 100, settings.tempB);
}
// ИК, вентилятор, термистор
#define P_IR PIN_PD2
#define P_FAN PIN_PB3
#define P_NTC PIN_A6
// энкодер
#define P_ENC_A PIN_PD4
#define P_ENC_B PIN_PD5
#define P_BTN PIN_PD6
// светодиод
#define P_LED_R PIN_PD3
#define P_LED_G PIN_PB1
#define P_LED_B PIN_PB2
// сегменты
#define P_SSA PIN_PD7
#define P_SSB PIN_PC0
#define P_SSC PIN_PC1
#define P_SSD PIN_PC2
#define P_SSE PIN_PC3
#define P_SSF PIN_PC4
#define P_SSG PIN_PC5
// DIGи
#define P_G1 PIN_PD0
#define P_G2 PIN_PD1
#define P_G3 PIN_PB0
#define P_G4 PIN_PB4
Да, там define на самом деле, не знаю почему тут перевелось.#define P_ENC_A PIN_PD4
// так правильно
Исправьте во всех строках вашего файла.