Salve, sto facendo un passo avanti, o meglio sto cercando di farlo, e di creare per bene gli header ed i file cpp per le varie classi. Ecco un estratto:
File .INO
// Debug variable
#define DEBUG;
#include "VariableDefinitions.h"
#include "EEPROMHandler.h"
#include "SplahScreenPage.h"
#include "MainPage.h"
#include "SetupPage.h"
#include "SetValuesPage.h"
#include "DinamicChartFrame.h"
DinamicChartFrame.h:
#ifndef DINAMICCHARTFRAME_H_
#define DINAMICCHARTFRAME_H_
//#define CHART_DEBUG
class DinChart {
public:
void drawChart(int roomIndex, double value);
void clearChartArea(int roomIndex);
void handleDinamicChart(int roomIndex);
};
#endif /* DINAMICCHARTFRAME_H_ */
Estratto del file
DinamicChartFrame.cpp:
#include "DinamicChartFrame.h"
void DinChart::handleDinamicChart(int roomIndex) {
// Checks if the maximum value for Y axis has changed
if (roomPV[roomIndex] > chartMaxY[roomIndex]) {
isAxisRefreshNeeded[roomIndex] = true;
chartMaxY[roomIndex] = round(roomPV[roomIndex]) + 1;
isChartRefreshNeeded[roomIndex] = true;
}
// Draw axes
if (isAxisRefreshNeeded[roomIndex] || isChartRefreshNeeded[roomIndex]) {
isAxisRefreshNeeded[roomIndex] = false;
isChartRefreshNeeded[roomIndex] = false;
// display.setColor(VGA_AQUA);
display.drawHLine(CHART_FRAME_X1 + CHART_FRAME_OFFSET * (roomIndex),
Il problema sorge nel momento in cui nel file .INO dichiaro l'oggetto di tipo DinChart e poi tento di istanziarlo:
DinChart newChart;
.
.
.
.
.
// Draws chart if requested
if (mainWindow)
for (int chartIndex = 0; chartIndex <= 1; chartIndex++) {
if (isRoomActive[chartIndex] && roomCreateChart[chartIndex])
newChart.handleDinamicChart(chartIndex);
}
Ottengo il seguente errore in compiazione:
"D:\GoogleDrive\sloeber\/arduinoPlugin/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"D:\GoogleDrive\sloeber\arduinoPlugin\packages\arduino\hardware\avr\1.6.20\cores\arduino" -I"D:\GoogleDrive\sloeber\arduinoPlugin\packages\arduino\hardware\avr\1.6.20\variants\mega" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\tinyFAT\tinyFAT" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\URTouch\URTouch" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\UTFT\UTFT" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\UTFT_Buttons\UTFT_Buttons" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\UTFT_tinyFAT\UTFT_tinyFAT" -I"D:\GoogleDrive\sloeber\arduinoPlugin\libraries\UTFT_Geometry\UTFT_Geometry" -I"D:\GoogleDrive\sloeber\arduinoPlugin\packages\arduino\hardware\avr\1.6.20\libraries\EEPROM" -I"D:\GoogleDrive\sloeber\arduinoPlugin\packages\arduino\hardware\avr\1.6.20\libraries\EEPROM\src" -MMD -MP -MF".ino.cpp.d" -MT".ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\.ino.cpp" -o ".ino.cpp.o"
In file included from ..\.ino.cpp:23:0:
..\FermentingController1_0.ino: In function 'void loop()':
..\FermentingController1_0.ino:78:34: error: 'handleDinamicChart' was not declared in this scope
handleDinamicChart(chartIndex);
^
Cioè so che ho sbagliato una scemenza ma non ci arrivo mica eh....boh, sarà l'età forse?