Netduino.. Speak!

I have finally taken some time to look at ThingSpeak.
A free online service where you can log data, which visualizes it in a nice graph.
I used the uPLibrary for .NET Micro Framework and used it’s classes for ThingSpeak in a small controller.

</pre>
public static class ThingSpeakController
{
private static string _key = "API KEY GOES HERE";
public static void SendTemperature(double temperature)
{
try
{
var dataEntry = new DataEntry();
dataEntry.DateTime = DateTime.Now;
dataEntry.Fields[0] = temperature.ToString();
dataEntry.Location = new Location()
{
Elevation = 0,
Latitude = 51.049153,
Longitude = 3.702750
};
var client = new ThingSpeakClient(false);
client.Update(_key, dataEntry);
}
catch (Exception ex)
{
Debug.Print("Exception during ThingSpeak: " + ex.Message);
}

}
}
<pre>

All this results in my Netduino logging its Temperature on ThingSpeak.

http://api.thingspeak.com/channels/11664/charts/1

Advertisements

Care to comment?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s