Library for easy communication with ThingSpeak servers.
- Channels
- Updating channels
- TalkBack
- Executing the next command
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.
client.setChannel(String key);
Sets the channel API key.
client.setTalkBack(int id, String key);
client.setTalkBack(String id, String key);
Sets the TalkBack ID and API key.
client.setThingTweet(String key);
Sets the ThingTweet API key.
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
.
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
.
client.update();
Updates the channel using the current values.
String command = client.nextCommand();
Fetches/executes the next TalkBack command.
client.addCommand(String command);
Sends/adds a new TalkBack command.
client.tweet(String status);
Posts a new status update on Twitter.