Post by drolli on Dec 21, 2016 16:16:03 GMT
Hi,
the attached test program compiles only if I comment out the Strings in robot.h. But on a arduino mega it runs without problems...
Could anyone tell me whats going wrong?
bye
Reiner
Test.ino
mower.cpp
mower.h
robot.cpp
robot.h
the attached test program compiles only if I comment out the Strings in robot.h. But on a arduino mega it runs without problems...
Could anyone tell me whats going wrong?
bye
Reiner
Test.ino
/*** Don't worry, the normal Arduino setup() and loop() are below this block! ***/
/* LMU uninitialised data */
StartOfUninitialised_LMURam_Variables
/* Put your LMU RAM fast access variables that have no initial values here e.g. uint32 LMU_var; */
EndOfUninitialised_LMURam_Variables
/* LMU uninitialised data */
StartOfInitialised_LMURam_Variables
/* Put your LMU RAM fast access variables that have an initial value here e.g. uint32 LMU_var_init = 1; */
EndOfInitialised_LMURam_Variables
/* If you do not care where variables end up, declare them here! */
/*** Core 0 ***/
void setup() {
// put your setup code for core 0 here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
//Serial.begin(19200); // open the serial port at 9600 bps:
//SerialASC.begin(9600);
}
void loop() {
// put your main code for core 0 here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
//SerialASC.print("AN\n\r");
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
//SerialASC.print("AUS\n\r");
delay(1000); // wait for a second
}
/*** Core 1 ***/
/* CPU1 Uninitialised Data */
StartOfUninitialised_CPU1_Variables
/* Put your CPU1 fast access variables that have no initial values here e.g. uint32 CPU1_var; */
EndOfUninitialised_CPU1_Variables
/* CPU1 Initialised Data */
StartOfInitialised_CPU1_Variables
/* Put your CPU1 fast access variables that have an initial value here e.g. uint32 CPU1_var_init = 1; */
EndOfInitialised_CPU1_Variables
void setup1() {
// put your setup code for core 1 here, to run once:
}
void loop1() {
// put your main code for core 1 here, to run repeatedly:
}
/*** Core 2 ***/
/* CPU2 Uninitialised Data */
StartOfUninitialised_CPU2_Variables
/* Put your CPU2 fast access variables that have no initial values here e.g. uint32 CPU2_var; */
EndOfUninitialised_CPU2_Variables
/* CPU2 Initialised Data */
StartOfInitialised_CPU2_Variables
/* Put your CPU2 fast access variables that have an initial value here e.g. uint32 CPU2_var_init = 1; */
EndOfInitialised_CPU2_Variables
void setup2() {
// put your setup code for core 2 here, to run once:
}
void loop2() {
// put your main code for core 2 here, to run repeatedly:
}
mower.cpp
#include <Arduino.h>
#include "mower.h"
Mower robot;
Mower::Mower()
{
xname = "Name";
}
void Mower::setupx()
{
Robot::setupx();
}
void Mower::resetMotorFault()
{
SerialASC.print("Blabla");
}
mower.h
#ifndef MOWER_H
#define MOWER_H
#include <Arduino.h>
#include "robot.h"
class Mower : public Robot
{
public:
Mower();
virtual void setupx(void);
virtual void resetMotorFault();
};
extern Mower robot;
#endif
robot.cpp
#include "robot.h"
Robot::Robot()
{
xname = "Generic";
esp8266ConfigString = "";
developerActive = false;
Test1 = Test2 = Test3 = 0;
}
void Robot::setupx()
{
SerialASC.print("START\n\r");
}
void Robot::loopx()
{
SerialASC.print("START\n\r");
}
void Robot::printSettingSerial()
{
}
robot.h
#ifndef ROBOT_H
#define ROBOT_H
#include <Arduino.h>
#include <WString.h>
class Robot
{
public:
String xname;
String esp8266ConfigString;
bool developerActive;
byte Test1;
byte Test2;
byte Test3;
Robot();
// robot setup
virtual void setupx();
// robot main loop
virtual void loopx();
protected:
virtual void printSettingSerial();
};
#endif