I have an IFTTT do button calling the test function in the code below. It compiles, and I can flash the core, but if I add the servo stuff, all that happens is that the breathing cyan light blinks a little and I get a notice from IFTTT that there was an error. I can successfully call functions if I’m doing other things besides using the servo library. If I try to do some serial debugging by putting a print statement in the function handler, nothing prints, so it’s not getting called. Any thoughts?
I added return 0; to the function handler, and I also used external 5V power for the servo. Still getting the same result. I have gotten this servo to work without using the IFTTT Do button. P.S. If I call the function using CURL, it works. I can call other functions using the do button, but I can’t if there’s servo code in there, so it seems.
Ok, renamed function to test3, revised the do button recipe. Again, after pressing the do button, the spark LED will flash a few times and go back to breathing cyan, and I’ll get an error message from IFTTT.
OK that must be the RGB control version above. The delay of 5 seconds before returning a value to the cloud is a problem. It is much better to treat the Spark function like an interrupt handler and do the minimum work there, but set a variable so that more work is done in loop(), like you had for the servo.
did all that, nothing worked. failed a couple of times in front of my classes. tonight, however, i prevailed. i think it might have something with the do button’s default to sending data to the function that isn’t handled? this is conjecture at this point, but i used the same recipe, but just deleted the args being passed to the function, and everything worked. the servo responded to its call. i’d need to sit down and focus to really be sure this was the case…