Thingspeak (OP-LIB-014)

From openPicus Wiki
Jump to: navigation, search

Contents

Description

This library allows to use all functions of ThingSpeak.com (web 2.0).

Content

  • thingspeak.c
  • thingspeak.h

Download

OP-LIB-014

Connections

Importing into OpenPicus IDE

Import ALL the files of the library using the button “external lib” of the IDE, then Include thingspeak.h in the files in which you want to use the functions (using the directive #include “thingspeak.h”). How To import external Lib Tutorial

Remember to increase the TX and RX buffer of the Generic TCP Client in the wizard.

Commands


wfTHINGSPEAK

Function to write float data in a specific ThingSpeak database.

Returns:

  • 0 – No error
  • 1 – TCPClientOpen error
BYTE wfTHINGSPEAK(char* writeapikey, float* value, int nvalue);
Argument Description
char* apikey ThingSpeak write api key
float* value array with float data to send to ThingSpeak
int nvalue number of array elements


wiTHINGSPEAK

Function to write integer data in a specific ThingSpeak database

Returns:

  • 0 – No error
  • 1 – TCPClientOpen error
BYTE wiTHINGSPEAK(char* writeapikey,int* value, int nvalue);
Argument Description
char* writeapikey ThingSpeak write api key
int* value array with integer data to send to ThingSpeak
int nvalue number of array elements


thingHTTP

Function to use ThingHTTP APP. Returns:

  • 0 – No error
  • 1 – TCPClientOpen error
  • 2 – ThingSpeak response timeout
BYTE thingHTTP(char* apikey, char* data)
Argument Description
char* apikey ThingSpeak write api key
char* data pointer to the return data/string array from ThingSpeak


thingTWEET

Function to use ThingHTTP APP.


Returns:

  • 0 – No error
  • 1 – TCPClientOpen error
BYTE thingTWEET(char* apikey, char* message)
Argument Description
char* apikey ThingSpeak TWEET api key
char* message message to send on Twitter to change status, you can add some tag in this way:
  • message&lat=(your latitude)&long=(your longitude)

for available tags see this: twitter API

Related Resources

Credits

stefano Saccucci - v1.2 www.notonlyelectronic.com

Personal tools
Namespaces

Variants
Actions
START HERE
DEVELOPMENT
HARDWARE INFO
RESOURCES
PHASED OUT
Toolbox