So I am confused by the behavior of this code. I havent written any spark/c++
code before so I cant figure out what Im doing wrong.
timing.ino
int unix_time = 0;
void setup()
{
Spark.variable("unix_time", &unix_time, INT);
}
void loop()
{
unix_time=Time.now();
delay(1000);
}
poll.sh
#! /bin/bash
while true
do
echo
echo ------------------------------
date
echo unix time
spark get rockvole3 unix_time
sleep 30
done
output
------------------------------
Tue Aug 26 16:00:28 PDT 2014
unix time
1409094032
------------------------------
Tue Aug 26 16:01:05 PDT 2014
unix time
1409094063
------------------------------
Tue Aug 26 16:01:36 PDT 2014
unix time
1409094094
I believe I am putting the time into the unix_time variable every minute, but the output shows that it is being updated more regularly than that?