Door Lock Project

Hi @Mohrad,

Sounds like a fun project! The stock Tinker app is just another firmware you can load on your core. If you want to add your own custom functionality to it, you can just start with tinker and start adding functions. Just grab the source from here and hack away! – If you leave in the digitalwrite / etc, you can keep controlling your core from your phone.

https://github.com/spark/core-firmware/blob/master/src/application.cpp

A bunch of community members have also made great example apps for controlling custom projects, for example:

I think in this case you just want to hook your functions up to the API as well:

//in setup
Spark.function("checkKeyStatus", checkKeyStatus);
Spark.function("doorHandle", doorHandle);

//elsewhere
int checkKeyStatus(String args) {
	//
}

int doorHandle(String args) {
	//
}

Hope this helps!
David

1 Like