some of the members of the forums and me already try to solve an issue here - https://community.spark.io/t/adafruit-neopixel-library/1143/104 - it’s about the NeoPixel lib and Spark Core - but I would love to get some more insights how the exposed functions in general work. I assume it is some kind of timing issue. It would be great to get some feedback.
Let’s say I have exposed a function like this
- What happens when in the loop() some longer-running code is executing? Would that code be interrupted if a function call for “lights” comes in?
- Or does the Spark Core check for function calls after each time the code in loop() was running?
- Are there any requirements how long a exposed function, lights, should run. Can code in the exposed function for example run a few seconds? What is the timeout?
- I also heard that there are some differences between Arduino and Spark Core. Are these documented somewhere? I think a lot are probably “prototyping” snippets of code on Arduino, then copying snippets over to the Spark Build environment. It would be graet to know what is ok and what not.
- Somewhere I saw an example that calculating some value within a function call is no good - it was around functionCall(i++, BLA) - the problem is the i++ within the function call - is that true? Would one better calculate the new value of i outside, e.g. put it above the line seperately and then just pass i?