After Flashing a Sketch can I connect it to the Phone Application?

I was creating a simple if statement to the Blink to see if the phone app still connected. I set the A0 to Write and created an if statement.
void Loop()
if (sensePin == 255){
Blink LED’s
}

I flashed it to the Spark Core and then went to the phone app and set A0 to Write and dragged the variable over to 255 position. A second later I get a statement that I’m disconnected from the core. So… I reconnect by placing it in smart mode. It finds it and connects but after the app starts, I get the same error. I tried it on another Spark Core and it did the same thing. I’m wondering if the Spark Android App doesn’t run after it’s flashed with a program. when I do a factory reset, it hooks back up to the Android app and works fine… What gives? How can I use the app to activate an event… By the way… Placing a 3.4 V signal at A0 doesn’t cause the LED’s to flash… What am I doing wrong?

As of now,

only the default tinker app/firmware will work with the Mobile App.

You should be able to include the tinker functions in your own app but someone will have to dig the code :smiley:

The code that runs when you use the app is just another sketch. Therefor, if you flash your own sketch, this default one gets overwritten, and can no longer be made use of.
The sketch itself isn’t that complicated, and can be found here: https://github.com/spark/core-firmware/blob/master/src/application.cpp
You can implement the code from this into your own sketch, or try to fit your sketch into the Tinker, both should work.

Good luck!