Hi there
I am trying to move from Arduino to Spark and am trying to troubleshoot the beginnings of my project.
I am not trying to get people to troubleshoot my project, just trying to understand the output of the web IDE… the Arduino IDE used to tell me which line the error was in, but this doesn’t (obviously) to me.
Also, is the Button library pre-installed?
Here is a sample output
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from DallasTemperature.h:1,
from DallasTemperature.cpp:10:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from OneWire.h:1,
from OneWire.cpp:126:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from digoleGeo.h:23,
from digoleGeo.cpp:5:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from digoleGeo.cpp:5:0:
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const String&)':
digoleGeo.h:146:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const char*)':
digoleGeo.h:152:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(char)':
digoleGeo.h:158:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(unsigned char, int)':
digoleGeo.h:164:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(int, int)':
digoleGeo.h:170:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(unsigned int, int)':
digoleGeo.h:176:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(long int, int)':
digoleGeo.h:182:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(long unsigned int, int)':
digoleGeo.h:188:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(double, int)':
digoleGeo.h:194:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const Printable&)':
digoleGeo.h:200:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println()':
digoleGeo.h:204:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const String&)':
digoleGeo.h:210:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const char*)':
digoleGeo.h:215:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(char)':
digoleGeo.h:220:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(unsigned char, int)':
digoleGeo.h:225:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(int, int)':
digoleGeo.h:230:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(unsigned int, int)':
digoleGeo.h:235:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(long int, int)':
digoleGeo.h:240:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(long unsigned int, int)':
digoleGeo.h:245:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(double, int)':
digoleGeo.h:250:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const Printable&)':
digoleGeo.h:255:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.cpp: In member function 'void DigoleSerialDisp::drawRoundRect(int, int, int, int)':
digoleGeo.cpp:270:6: warning: unused variable 'tmp' [-Wunused-variable]
digoleGeo.cpp: In member function 'void DigoleSerialDisp::fillRoundRect(int, int, int, int)':
digoleGeo.cpp:294:6: warning: unused variable 'tmp' [-Wunused-variable]
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from displaytemp.cpp:3:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from displaytemp.cpp:4:0:
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const String&)':
digoleGeo.h:146:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const char*)':
digoleGeo.h:152:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(char)':
digoleGeo.h:158:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(unsigned char, int)':
digoleGeo.h:164:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(int, int)':
digoleGeo.h:170:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(unsigned int, int)':
digoleGeo.h:176:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(long int, int)':
digoleGeo.h:182:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(long unsigned int, int)':
digoleGeo.h:188:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(double, int)':
digoleGeo.h:194:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println(const Printable&)':
digoleGeo.h:200:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::println()':
digoleGeo.h:204:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const String&)':
digoleGeo.h:210:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const char*)':
digoleGeo.h:215:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(char)':
digoleGeo.h:220:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(unsigned char, int)':
digoleGeo.h:225:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(int, int)':
digoleGeo.h:230:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(unsigned int, int)':
digoleGeo.h:235:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(long int, int)':
digoleGeo.h:240:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(long unsigned int, int)':
digoleGeo.h:245:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(double, int)':
digoleGeo.h:250:5: warning: no return statement in function returning non-void [-Wreturn-type]
digoleGeo.h: In member function 'size_t DigoleSerialDisp::print(const Printable&)':
digoleGeo.h:255:5: warning: no return statement in function returning non-void [-Wreturn-type]
displaytemp.cpp: At global scope:
displaytemp.cpp:9:27: error: no matching function for call to 'DigoleSerialDisp::DigoleSerialDisp(int)'
displaytemp.cpp:9:27: note: candidates are:
In file included from displaytemp.cpp:4:0:
digoleGeo.h:36:7: note: DigoleSerialDisp::DigoleSerialDisp()
digoleGeo.h:36:7: note: candidate expects 0 arguments, 1 provided
digoleGeo.h:36:7: note: constexpr DigoleSerialDisp::DigoleSerialDisp(const DigoleSerialDisp&)
digoleGeo.h:36:7: note: no known conversion for argument 1 from 'int' to 'const DigoleSerialDisp&'
displaytemp.cpp:9:18: error: cannot declare variable 'mydisp' to be of abstract type 'DigoleSerialDisp'
In file included from displaytemp.cpp:4:0:
digoleGeo.h:36:7: note: because the following virtual functions are pure within 'DigoleSerialDisp':
In file included from ../inc/spark_wiring_stream.h:38:0,
from ../inc/spark_wiring.h:35,
from ../inc/application.h:31,
from displaytemp.cpp:3:
../inc/spark_wiring_print.h:59:20: note: virtual size_t Print::write(uint8_t)
displaytemp.cpp: In function 'void setup()':
displaytemp.cpp:34:10: error: 'class DigoleSerialDisp' has no member named 'begin'
displaytemp.cpp:45:2: error: 'Button' was not declared in this scope
displaytemp.cpp:45:9: error: expected ';' before 'btnSet'
make: *** [displaytemp.o] Error 1
And there is my code (there are also the included libraries). This code was working then I have done some additions and cant get it working (and I can’t remember what the changes were!!)
#include "OneWire.h"
#include "DallasTemperature.h"
#include "digoleGeo.h"
#define _Digole_Serial_SPI_ //set OLED to use SPI
DigoleSerialDisp mydisp(SS); //setup OLED display
#define TEMPINTERVAL 500 //sampling frequency for tempsensor
float temperature = 0;
unsigned long lastTempRequest = 0;
OneWire oneWire(D3); //set Temp sensor pin
DallasTemperature sensor(&oneWire);
DeviceAddress tempDeviceAddress;
char temperatureStr[10];
#define pin_A D0
#define pin_B D1
#define BTN_SET D2
//enum programmode {
// menumode,
// cooking,
// startup,
// probedetected,
// noprobe,
//};
//programmode mode = startup;
void setup() {
mydisp.begin();
sensor.begin();
sensor.getAddress(tempDeviceAddress, 0);
sensor.setResolution(tempDeviceAddress, 12);
sensor.setWaitForConversion(false);
sensor.requestTemperatures();
lastTempRequest = millis();
Spark.variable("temperature", &temperatureStr, STRING);
pinMode(pin_A, INPUT);
pinMode(pin_B, INPUT);
Button btnSet = Button(BTN_SET, define_resistor);
//digitalWrite(pin_A, HIGH); //are these lines needed?
//digitalWrite(pin_B, HIGH);
}
void loop() {
if (millis() - lastTempRequest >= TEMPINTERVAL)
{
sensor.requestTemperatures();
temperature = sensor.getTempCByIndex(0);
lastTempRequest = millis();
sprintf(temperatureStr,"%.2f",temperature);
mydisp.clearScreen();
mydisp.setRot180();
mydisp.setPrintPos(1, 3);
mydisp.setFont(123);
mydisp.disableCursor();
mydisp.print(temperature, 1);
}
}