compiling error Sprinter firmware

3,185 views
Skip to first unread message

Dik@DPC

unread,
Mar 30, 2012, 10:05:17 AM3/30/12
to Shapercube Support Group
I have tried to verify and upload the Sprinter firmware to my Arduino
Mega 256.
It makes no difference if the Arduino is connected or not.

I keep getting the followig error message:

HIGH was not declared in this scope

It referres to the line under the TAB Sd2Card.cpp:

void Sd2Card::chipSelectHigh(void) {
digitalWrite(chipSelectPin_, HIGH);

In the error log window the following list of errors appeared.


Sd2Card.cpp:20:22: error: WProgram.h: No such file or directory
Sd2Card.cpp: In member function 'void Sd2Card::chipSelectHigh()':
Sd2Card.cpp:145: error: 'HIGH' was not declared in this scope
Sd2Card.cpp:145: error: 'digitalWrite' was not declared in this scope
Sd2Card.cpp: In member function 'void Sd2Card::chipSelectLow()':
Sd2Card.cpp:149: error: 'LOW' was not declared in this scope
Sd2Card.cpp:149: error: 'digitalWrite' was not declared in this scope
Sd2Card.cpp: In member function 'uint8_t Sd2Card::init(uint8_t,
uint8_t)':
Sd2Card.cpp:216: error: 'millis' was not declared in this scope
Sd2Card.cpp:220: error: 'OUTPUT' was not declared in this scope
Sd2Card.cpp:220: error: 'pinMode' was not declared in this scope
Sd2Card.cpp:222: error: 'INPUT' was not declared in this scope
Sd2Card.cpp: In member function 'uint8_t
Sd2Card::waitNotBusy(uint16_t)':
Sd2Card.cpp:471: error: 'millis' was not declared in this scope
Sd2Card.cpp: In member function 'uint8_t Sd2Card::waitStartBlock()':
Sd2Card.cpp:481: error: 'millis' was not declared in this scope

zapgadget

unread,
Apr 24, 2012, 4:05:17 AM4/24/12
to shape...@googlegroups.com
It's down to changes in the Arduino environment V1.0.  I found an answer which worked for me on the reprap forums:


sfisher10
In case anybody is interested, Sprinter will compile with Arduino 1.0 
with the following changes: 

Sd2Card.cpp 

#include <WProgram.h> --> #include <Arduino.h> 

SdFat.h 

void write(uint8_t b); --> size_t write(uint8_t b); 

SdFile.h 

#include <WProgram.h> --> #include <Arduino.h> 

void SdFile::write(uint8_t b) { --> size_t SdFile::write(uint8_t b) 


Sprinter.h 

#include <WProgram.h> --> #include <Arduino.h> 

Also, the IDE will rename "Sprinter.pde" to "Sprinter.ino" as ".ino" 
is the new default file extension.

brad.pau...@gmail.com

unread,
Oct 9, 2012, 9:45:02 PM10/9/12
to shape...@googlegroups.com
Worked perfectly! Thanks a mil. (A couple of your .h file names are really .cpp, but we get it.)

miguelang...@gmail.com

unread,
Jun 11, 2013, 3:50:30 AM6/11/13
to shape...@googlegroups.com
Thanks

erik.ve...@gmail.com

unread,
Jan 25, 2014, 3:48:01 PM1/25/14
to shape...@googlegroups.com
Thank you very much zapgadget it works like a charm
Message has been deleted

onnie...@gmail.com

unread,
May 10, 2014, 9:46:39 AM5/10/14
to shape...@googlegroups.com
AH! got it. THANKS!

onnie...@gmail.com

unread,
May 10, 2014, 9:57:24 AM5/10/14
to shape...@googlegroups.com, onnie...@gmail.com


On Saturday, May 10, 2014 10:46:39 PM UTC+9, onnie...@gmail.com wrote:
AH! got it. THANKS!

BTW: do not rename SdFile.cpp to SdFile.h

it screws a lot of things up

doncs...@gmail.com

unread,
Aug 15, 2014, 1:53:50 PM8/15/14
to shape...@googlegroups.com
An easier solution is to create a WProgram.h file that includes Arduino.h and place it in the directory with Arduino.h.
Reply all
Reply to author
Forward
0 new messages