I have a maddening compile error which I have already spent too much time on. Can someone please help?
The message is:
Arduino: 1.6.5 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
D:DDocumentsArduino SketcheslibrariesAClockAClock.cpp: In function 'void setOnce(boolean)':
D:DDocumentsArduino SketcheslibrariesAClockAClock.cpp:11:3: error: 'once' was not declared in this scope
once = flip; // "once was not declared in this scope" ! ...but once is private in this class"
^
...and here is the code... just the juicy bits...
My sketch (in D:DDocumentsArduino SketchesATestclock)
ACLock.h (in D:DDocumentsArduino SketcheslibrariesAClock)
#include <arduino.h>
#ifndef AClock_h
#define AClock_h
class AClock{
public:
void setOnce(boolean flip){
// Set flag so we can do things once.
}
boolean getOnce(){
// Get the once flag value
}
private:
boolean once;
}; // End class Clock
#endif
AClock.cpp (same folder as AClock.h)
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <AClock.h>
void setOnce(boolean flip){
// Set flag so we can do things once.
once = flip; // "once was not declared in this scope" ! ...but once is private in this class"
}
boolean getOnce(){
// Get the once flag value
return once;
}
void AClock::setOnce(boolean flip){
// Set flag so we can do things once.
once = flip;
}
boolean AClock::getOnce(){
// Get the once flag value
return once;
}
Fixing this will probably show the next error:
class AClock{
public:
void setOnce(boolean flip){
// Set flag so we can do things once.
}
boolean getOnce(){
// Get the once flag value
}
private:
boolean once;
};
I get same error with the same file in both win 7-1 and Linux Ubuntu 14.04 and it is supposed to be for the Geetech I3 Pro C Dual Extruder 3D Printer with GT2560 Version A
Temperature.cpp: In function “Void manage_heater()'s
Temperature.cpp:665:1 error unable to find a register to spill in class 'POINTER_REGS'
}
^
temperature.cpp: 665:1 error : this is insn:
(isn 95 94 97 4 ( set (reg/v:SF 103 [ pid_input ]
( mem: SF (post_inc:HI 146 [ ivtmp.209v] ) ) [4 MEM [base:_110.
Offset: 0B]+0 S4 A8] ) ) temperature.cpp:449 99 {*movsf}
(expr_list : REG_INC (reg : HI 146 [ivtmp.209 ] )
(nil) ) )
temperature.cpp:665 confused by earlier errors, bailing out
that is what I get . . I have no ideal as to how to fix it as I got the files already editied and for my 3D printer