Skip to content

Commit d195897

Browse files
Merge pull request #9 from arduino-libraries/release1.1.8
Release1.1.8
2 parents 0137316 + 35c816e commit d195897

17 files changed

+1530
-211
lines changed

examples/ArduinoYun/CloudControlsConfig/CloudControlsConfig.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void setup() {
2828
Serial.println();
2929
// upgrade the Temboo package
3030
Serial.print("Updating Temboo...");
31-
p.runShellCommand("opkg install http://downloads.arduino.cc/openwrtyun/1/packages/temboo_1.3.1-1_ar71xx.ipk");
31+
p.runShellCommand("opkg install http://downloads.arduino.cc/openwrtyun/1/packages/temboo_1.4.0-1_ar71xx.ipk");
3232
returnCode = p.exitValue();
3333
if (returnCode == 0) {
3434
Serial.println("Success!");
@@ -88,7 +88,7 @@ void setup() {
8888
}
8989
return;
9090
}
91-
91+
Serial.println();
9292
Serial.println("Update Complete - your Yun is ready for Cloud Controls!");
9393
}
9494

examples/ArduinoYun/SendAnEmail/SendAnEmail.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Demonstrates sending an email via a Google Gmail account using Temboo from an Arduino Yún.
55
6-
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
6+
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
77
88
A Temboo account and application key are necessary to run all Temboo examples.
99
If you don't already have one, you can register for a free Temboo account at
@@ -34,13 +34,13 @@
3434
3535
9. Copy and paste this password into the code below, updating the GMAIL_APP_PASSWORD variable
3636
37-
10. Upload the sketch to your Arduino Yún and open Arduino's serial monitor
37+
10. Upload the sketch to your Arduino Yún and open the serial monitor
3838
3939
NOTE: You can test this Choreo and find the latest instructions on our website:
4040
https://temboo.com/library/Library/Google/Gmail/SendEmail
4141
4242
You can also find an in-depth version of this example here:
43-
https://temboo.com/hardware/ti/send-an-email
43+
https://temboo.com/arduino/yun/send-an-email
4444
4545
This example assumes basic familiarity with Arduino sketches, and that your Yún is connected
4646
to the Internet.

examples/ArduinoYun/SendDataToGoogleSpreadsheet/SendDataToGoogleSpreadsheet.ino

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Demonstrates appending a row of data to a Google spreadsheet using Temboo from an Arduino Yún.
55
6-
Check out the latest Arduino & Temboo examples and support docs at http://www.temboo.com/arduino
6+
Check out the latest Arduino & Temboo examples and tutorials at http://www.temboo.com/arduino
77
88
A Temboo account and application key are necessary to run all Temboo examples.
99
If you don't already have one, you can register for a free Temboo account at
@@ -12,8 +12,11 @@
1212
Instructions:
1313
1414
1. Create a Temboo account: http://www.temboo.com
15+
1516
2. Retrieve your Temboo application details: http://www.temboo.com/account/applications
17+
1618
3. Replace the values in the TembooAccount.h tab with your Temboo application details
19+
1720
4. You'll also need a Google Spreadsheet that includes a title in the first row
1821
of each column that data will be written to. This example assumes there are two columns.
1922
The first column is the time (in milliseconds) that the row was appended, and the second
@@ -29,20 +32,20 @@
2932
3033
https://temboo.com/library/Library/Google/OAuth/
3134
32-
For the scope field, you need to use: https://spreadsheets.google.com/feeds/
35+
For the scope field, you need to use: https://www.googleapis.com/auth/spreadsheets
3336
3437
Here's a video outlines how Temboo helps with the OAuth process:
3538
3639
https://www.temboo.com/videos#oauthchoreos
3740
3841
And here's a more in-depth version of this example on our website:
3942
40-
https://temboo.com/hardware/ti/update-google-spreadsheet
41-
42-
6. Next, upload the sketch to your Arduino Yún and open Arduino's serial monitor
43+
https://temboo.com/arduino/yun/update-google-spreadsheet
4344
45+
6. Next, upload the sketch to your Arduino Yún and open the serial monitor
46+
4447
Note: you can test this Choreo and find the latest instructions on our website:
45-
https://temboo.com/library/Library/Google/Spreadsheets/AppendRow/
48+
https://temboo.com/library/Library/Google/Sheets/AppendValues/
4649
4750
Looking for another API to use with your Arduino Yún? We've got over 100 in our Library!
4851
@@ -61,20 +64,20 @@
6164
// Note that for additional security and reusability, you could
6265
// use #define statements to specify these values in a .h file.
6366

64-
// the clientID found in Google's Developer Console under APIs & Auth > Credentials
67+
// the clientID found in Google's Developer Console under API Manager > Credentials
6568
const String CLIENT_ID = "your-client-id";
6669

67-
// the clientSecret found in Google's Developer Console under APIs & Auth > Credentials
70+
// the clientSecret found in Google's Developer Console under API Manager > Credentials
6871
const String CLIENT_SECRET = "your-client-secret";
6972

7073
// returned after running FinalizeOAuth
7174
const String REFRESH_TOKEN = "your-oauth-refresh-token";
7275

73-
// the title of the spreadsheet you want to send data to
74-
// (Note that this must actually be the title of a Google spreadsheet
75-
// that exists in your Google Drive/Docs account, and is configured
76-
// as described above.)
77-
const String SPREADSHEET_TITLE = "your-spreadsheet-title";
76+
// The ID of the spreadsheet you want to send data to
77+
// which can be found in the URL when viewing your spreadsheet at Google. For example,
78+
// the ID in the URL below is: "1tvFW2n-xFFJCE1q5j0HTetOsDhhgw7_998_K4sFtk"
79+
// Sample URL: https://docs.google.com/spreadsheets/d/1tvFW2n-xFFJCE1q5j0HTetOsDhhgw7_998_K4sFtk/edit
80+
const String SPREADSHEET_ID = "your-spreadsheet-id";
7881

7982
const unsigned long RUN_INTERVAL_MILLIS = 60000; // how often to run the Choreo (in milliseconds)
8083

@@ -114,47 +117,44 @@ void loop()
114117
Serial.println("Appending value to spreadsheet...");
115118

116119
// we need a Process object to send a Choreo request to Temboo
117-
TembooChoreo AppendRowChoreo;
120+
TembooChoreo AppendValuesChoreo;
118121

119122
// invoke the Temboo client
120123
// NOTE that the client must be reinvoked and repopulated with
121124
// appropriate arguments each time its run() method is called.
122-
AppendRowChoreo.begin();
125+
AppendValuesChoreo.begin();
123126

124127
// set Temboo account credentials
125-
AppendRowChoreo.setAccountName(TEMBOO_ACCOUNT);
126-
AppendRowChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
127-
AppendRowChoreo.setAppKey(TEMBOO_APP_KEY);
128+
AppendValuesChoreo.setAccountName(TEMBOO_ACCOUNT);
129+
AppendValuesChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
130+
AppendValuesChoreo.setAppKey(TEMBOO_APP_KEY);
128131

129-
// identify the Temboo Library choreo to run (Google > Spreadsheets > AppendRow)
130-
AppendRowChoreo.setChoreo("/Library/Google/Spreadsheets/AppendRow");
132+
// identify the Temboo Library choreo to run (Google > Sheets > AppendValues)
133+
AppendValuesChoreo.setChoreo("/Library/Google/Sheets/AppendValues");
131134

132135
// set the required Choreo inputs
133-
// see https://www.temboo.com/library/Library/Google/Spreadsheets/AppendRow/
136+
// see https://www.temboo.com/library/Library/Google/Sheets/AppendValues/
134137
// for complete details about the inputs for this Choreo
135138

136139
// your Google application client ID
137-
AppendRowChoreo.addInput("ClientID", CLIENT_ID);
138-
// your Google application client secert
139-
AppendRowChoreo.addInput("ClientSecret", CLIENT_SECRET);
140+
AppendValuesChoreo.addInput("ClientID", CLIENT_ID);
141+
// your Google application client secret
142+
AppendValuesChoreo.addInput("ClientSecret", CLIENT_SECRET);
140143
// your Google OAuth refresh token
141-
AppendRowChoreo.addInput("RefreshToken", REFRESH_TOKEN);
144+
AppendValuesChoreo.addInput("RefreshToken", REFRESH_TOKEN);
142145

143-
// the title of the spreadsheet you want to append to
144-
// NOTE: substitute your own value, retaining the "SpreadsheetTitle:" prefix.
145-
AppendRowChoreo.addInput("SpreadsheetTitle", SPREADSHEET_TITLE);
146+
// the ID of the spreadsheet you want to append to
147+
AppendValuesChoreo.addInput("SpreadsheetID", SPREADSHEET_ID);
146148

147149
// convert the time and sensor values to a comma separated string
148-
String rowData(now);
149-
rowData += ",";
150-
rowData += sensorValue;
150+
String rowData = "[[\"" + String(now) + "\", \"" + String(sensorValue) + "\"]]";
151151

152152
// add the RowData input item
153-
AppendRowChoreo.addInput("RowData", rowData);
153+
AppendValuesChoreo.addInput("Values", rowData);
154154

155155
// run the Choreo and wait for the results
156156
// The return code (returnCode) will indicate success or failure
157-
unsigned int returnCode = AppendRowChoreo.run();
157+
unsigned int returnCode = AppendValuesChoreo.run();
158158

159159
// return code of zero (0) means success
160160
if (returnCode == 0) {
@@ -163,13 +163,13 @@ void loop()
163163
} else {
164164
// return code of anything other than zero means failure
165165
// read and display any error messages
166-
while (AppendRowChoreo.available()) {
167-
char c = AppendRowChoreo.read();
166+
while (AppendValuesChoreo.available()) {
167+
char c = AppendValuesChoreo.read();
168168
Serial.print(c);
169169
}
170170
}
171171

172-
AppendRowChoreo.close();
172+
AppendValuesChoreo.close();
173173
}
174174
}
175175

keywords.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@
77
#######################################
88

99
Temboo KEYWORD1
10-
TembooMQTTEdgeDevice KEYWORD1
11-
TembooCoAPEdgeDevice KEYWORD1
12-
TembooYunShield KEYWORD1
10+
TembooMQTTEdgeDevice KEYWORD1
11+
TembooCoAPEdgeDevice KEYWORD1
12+
TembooYunShield KEYWORD1
1313

1414
#######################################
1515
# Datatypes (KEYWORD2)
1616
#######################################
1717

1818
TembooChoreo KEYWORD2
19-
TembooCoAPChoreo KEYWORD2
20-
TembooMQTTChoreo KEYWORD2
21-
TembooYunShieldChoreo KEYWORD2
19+
TembooCoAPChoreo KEYWORD2
20+
TembooMQTTChoreo KEYWORD2
21+
TembooYunShieldChoreo KEYWORD2
22+
TembooDS18B20Config KEYWORD2
23+
TembooGPIOConfig KEYWORD2
24+
TembooSensor KEYWORD2
2225

2326
#######################################
2427
# Methods and Functions (KEYWORD2)
@@ -40,3 +43,6 @@ setDeviceType KEYWORD2
4043
setSettingsFileToWrite KEYWORD2
4144
setSettingsFileToRead KEYWORD2
4245
setGatewayAddress KEYWORD2
46+
tembooDS18B20Init KEYWORD2
47+
tembooDigitalGPIOInit KEYWORD2
48+
tembooAnalogGPIOInit KEYWORD2

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ paragraph=Use this library to connect your Arduino or Genuino board to Temboo, m
66
category=Communication
77
url=http://www.temboo.com/arduino
88
architectures=*
9-
version=1.1.7
10-
core-dependencies=arduino (>=1.5.0)
9+
version=1.1.8
10+
core-dependencies=arduino (>=1.5.0)

src/Temboo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class TembooChoreo : public Process {
5151
void addInputExpression(const String& inputName, const String& inputValue) { addParameter("-f" + inputName + ":" + inputValue);}
5252
void addSensorInput(const String& sensorName, long sensorValue, const String& conversion) {addParameter("-n" + sensorName + ":" + String(sensorValue) + ":" + conversion);}
5353
void addSensorInput(const String& sensorName, long sensorValue) {addParameter("-v" + sensorName + ":" + String(sensorValue));}
54+
void addSensorInput(const String& sensorName, long sensorValue, const String& conversion, const String& calibrationValue) {addParameter("-b" + sensorName + ":" + String(sensorValue) + ":" + conversion + ":" + calibrationValue);}
5455
void addSensorInput(const String& sensorName, long sensorValue, const String& rawLow, const String& rawHigh, const String& scaleLow, const String& scaleHigh) {addParameter("-m" + sensorName + ":" + String(sensorValue) + ":" + rawLow+ ":" + rawHigh+ ":" + scaleLow+ ":" + scaleHigh);}
5556
void setDeviceName(const String& deviceName) {addParameter("-d" + deviceName);}
5657
void setDeviceType(const String& deviceType) {addParameter("-t" + deviceType);}

0 commit comments

Comments
 (0)