Skip to content

OpenLab-SI/ThingSpeak-Arduino

Repository files navigation

ThingSpeak

Library for easy communication with ThingSpeak servers.

Features

  • Channels
    • Updating channels
  • TalkBack
    • Executing the next command

API

Constructor

ThingSpeak client();

Creates a new ThingSpeak instance using the default API endpoints.

ThingSpeak client(String address);

Creates a new ThingSpeak instance using a custom address.

setChannel

client.setChannel(String key);

Sets the channel API key.

setTalkBack

client.setTalkBack(int id, String key);
client.setTalkBack(String id, String key);

Sets the TalkBack ID and API key.

setThingTweet

client.setThingTweet(String key);

Sets the ThingTweet API key.

addField

client.addField(String name);

Assigns a name to the next field. These names can then be used when setting a field value.

A maximum of 8 fields are supported. The first name added will map to field1, the next to field2... up to field8.

setField

client.setField(int field, any value);

Sets a field value for the next update. The field can be any number from 1 to 8.

client.setField(String name, any value);

Sets a field value for the next update. The field name can be any added field name or anything from field1 to field8.

update

client.update();

Updates the channel using the current values.

nextCommand

String command = client.nextCommand();

Fetches/executes the next TalkBack command.

addCommand

client.addCommand(String command);

Sends/adds a new TalkBack command.

tweet

client.tweet(String status);

Posts a new status update on Twitter.