Updating Latitude and Longitude from ThingSpeak Communication Library for Arduino | Arduino | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Updating Latitude and Longitude from ThingSpeak Communication Library for Arduino
Avatar
gregp228
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
1
May 15, 2016 - 11:18 am
sp_Permalink sp_Print

The ThingSpeak Communication Library for Arduino has location functions:

ThingSpeak KEYWORD1
begin KEYWORD2
writeField KEYWORD2
setField KEYWORD2
setLatitude KEYWORD2
setLongitude KEYWORD2
setElevation KEYWORD2
writeRaw KEYWORD2
writeFields KEYWORD2
readFloatField KEYWORD2
readIntField KEYWORD2
readLongField KEYWORD2
readStringField KEYWORD2
readRaw KEYWORD2
getLastReadStatus KEYWORD2

I am unable to get these to work.

int setLatitude(float latitude)
{
#ifdef PRINT_DEBUG_MESSAGES
Serial.print("ts::setLatitude(latitude: "); Serial.print(latitude,3); Serial.println("\")");
#endif
this->nextWriteLatitude = latitude;
return OK_SUCCESS;
};

/**
* @brief Set the longitude of a multi-field update.
* To record latitude, longitude and elevation of a write, call setField() for each of the fields you want to write, setLatitude() / setLongitude() / setElevation(), and then call writeFields()
* @param longitude Longitude of the measurement (degrees E, use negative values for degrees W)
* @return HTTP status code of 200 if successful. See getLastReadStatus() for other possible return values.
* @see setField(), setLatitude(), setElevation(), writeFields()
* @code
void loop() {
int sensor1Value = analogRead(A0);
float sensor2Voltage = analogRead(A1) * (5.0 / 1023.0);
String sensor3Meaning;
int sensor3Value = analogRead(A2);
if (sensor3Value < 400) {
sensor3Meaning = String("Too Cold!");
} else if (sensor3Value > 600) {
sensor3Meaning = String("Too Hot!");
} else {
sensor3Meaning = String("Just Right");
}
long timeRead = millis();

ThingSpeak.setField(1, sensor1Value);
ThingSpeak.setField(2, sensor2Voltage);
ThingSpeak.setField(3, sensor3Meaning);
ThingSpeak.setField(4, timeRead);
setLatitude(42.2833);
setLongitude(-71.3500);
setElevation(100);
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
delay(20000);
}
* @endcode
*/

The example from the library however does not work and setLatitude() will not compile

any help with this would be appreciated

12

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

candacele1

WilliamBer

roxieob18

Metawatch

ozayagw

ubabeutiti

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee