Spark.Variable update rate

The docs do not explicitly mention the update rate of void loop() on a Core (minus any user code induced latency). The comments in example say 5-15ms. Is that current, and is it expected to remain constant?

Should it be possible to use a library like SPI Serial to interface with serial sensors?

Hi @Bendrix

The doc doesn’t mention a specific rate because it varies with how much work you are asking the cloud to do. If you want more speed, you can turn the cloud connection off and turn it back on later if you need it. There is some good data in this thread:

Spark.variables are pull-type requests. When cloud asks your core for the value of a variable, that value is fetched from the memory locations you defined when you setup the Spark.variable and then it is sent to the cloud.

Soft SPI is possible but why would you need it with hardware-based SPI built in?

For the next firmware release, we’ve taken steps to reduce system overhead, and have measured loop frequencies of 230kHz with the cloud connected. Oh yeah! :smile:


Lazy. I have code that uses libraries that use spi serial. For the DHT22 temp and humidity sensor, for example.

Hi @Bendrix

You should check out @mtnscott DHT22 library for Spark. Everyone reports good success with that library and some failures with other libraries.

1 Like

Thanks. I’ll do that. Sorry for being ignorant but how do I get the driver from @mtnscott?

Hi @Bendrix

It is available on the libraries tab of the web IDE or on github directly (link in the web IDE). See this thread for detail–the search button works really here in Discourse too!

Wow! Thanks. That’s great.