not quite sure how to make the nice code boxes everyone else has so im just going to copy and paste my stuff here, i tried to compile using SparkDev and the web IDE but neither worked. any help is appreciated.
here is my code:
int WindowUp = D0;
int WindowDown = D1;
int isOpen = 0;
void setup() {
Spark.function("activate", WindowControl);
pinMode(WindowUp, OUTPUT);
pinMode(WindowDown, OUTPUT);
digitalWrite(WindowUp, LOW);
digitalWrite(WindowDown, LOW);
}
void loop() {
}
void WindowControl() {
if (isOpen == 0) {
digitalWrite(WindowUp, HIGH);
delay(500);
digitalWrite(WindowUp, LOW);
}
else if (isOpen == 1) {
digitalWrite(WindowDown, HIGH);
delay(500);
digitalWrite(WindowDown, LOW);
}
}
and the errors:
In file included from ../inc/spark_wiring.h:29:0,
from ../inc/application.h:29,
from the_user_app.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
the_user_app.cpp: In function 'void setup()':
the_user_app.cpp:7:45: error: invalid conversion from 'void (*)()' to 'int (*)(String)' [-fpermissive]
int WindowUp = 0;
^
In file included from ../inc/spark_wiring.h:33:0,
from ../inc/application.h:29,
from the_user_app.cpp:2:
../inc/spark_utilities.h:109:14: error: initializing argument 2 of 'static void SparkClass::function(const char*, int (*)(String))' [-fpermissive]
static void function(const char *funcKey, int (*pFunc)(String paramString));
^
make: *** [the_user_app.o] Error 1