# Spark.Variable update rate

**URL:** <https://community.particle.io/t/spark-variable-update-rate/11680>\
**Category:** Firmware\
**Created:** [May 8, 2015, 3:20pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680 "2015-05-08T15:20:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bendrix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bendrix/32/5001_2.png) [@Bendrix](https://community.particle.io/u/Bendrix)\
**Post date:** [May 8, 2015, 3:20pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/1 "2015-05-08T15:20:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 8, 2015, 3:59pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/2 "2015-05-08T15:59:21Z")

</div>

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 analog sample rate? (SOLVED)](https://community.particle.io/t/spark-analog-sample-rate-solved/7366)**
>
> Hi I just got my spark core kit - seems very good kit. I am a software person so not as familiar with the lights-and-wire part of things. Anyway I have a project in mind (basically a car RPM meter) and I want to check that the analog input sample...

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?

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [May 8, 2015, 4:24pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/3 "2015-05-08T16:24:10Z")

</div>

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! 😄

---

<div class="post-metadata">

**Author:** ![Bendrix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bendrix/32/5001_2.png) [@Bendrix](https://community.particle.io/u/Bendrix)\
**Post date:** [May 8, 2015, 4:56pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/4 "2015-05-08T16:56:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 8, 2015, 5:05pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/5 "2015-05-08T17:05:23Z")

</div>

Hi @Bendrix

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

---

<div class="post-metadata">

**Author:** ![Bendrix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bendrix/32/5001_2.png) [@Bendrix](https://community.particle.io/u/Bendrix)\
**Post date:** [May 8, 2015, 5:34pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/6 "2015-05-08T17:34:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 8, 2015, 5:38pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/7 "2015-05-08T17:38:51Z")

</div>

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!

[https://community.particle.io/t/submission-updated-non-blocking-interrupt-driven-dht-sensor-library/?redirected=true](https://community.particle.io/t/submission-updated-non-blocking-interrupt-driven-dht-sensor-library/?redirected=true)

---

<div class="post-metadata">

**Author:** ![Bendrix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bendrix/32/5001_2.png) [@Bendrix](https://community.particle.io/u/Bendrix)\
**Post date:** [May 8, 2015, 5:49pm UTC](https://community.particle.io/t/spark-variable-update-rate/11680/8 "2015-05-08T17:49:00Z")

</div>

Wow! Thanks. That’s great.
