problem compiling example code | ESP8266 Wi-Fi Module | 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
problem compiling example code
Avatar
mtmtntop
New Member
Forum Posts: 3
sp_UserOfflineSmall Offline
1
February 8, 2018 - 6:01 pm
sp_Permalink sp_Print

 Hi.  I was using this code from the examples:

https://www.mathworks.com/help/thingspeak/read-and-post-temperature-data.html

to do a simple 1820 temp read and post.  When i copied and pasted into arduino and tried to compile, I get this error:

Arduino: 1.8.5 (Windows 8.1), Board: "SparkFun ESP8266 Thing Dev, 80 MHz, 512K (no SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 115200"

D:\arduino sketches backup\sketch_feb08c\sketch_feb08c.ino: In function 'void loop()':

sketch_feb08c:58: error: 'write2TSData' was not declared in this scope

write2TSData( channelID , dataFieldOne , celsiusTemperature , dataFieldTwo , fahrenheitTemperature , dataFieldThree , millis() ); // Write the temperature in F, C, and time since starting.

^

exit status 1
'write2TSData' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I'm not very experienced at writing this code so I would appreciate any help.  thanks

Avatar
cstapels
Moderator
Forum Posts: 158
sp_UserOfflineSmall Offline
2
February 9, 2018 - 10:36 am
sp_Permalink sp_Print

 Your compiler cannot find the function write2TSData().  Make sure you copied it, its down at the bottom.  If its there and the compiler still cannot find it, this is most likely due to a missing open or close brace: '{' or '}' .

 I checked out the code on the site and there doesn't seem to be a missing brace there. (both the full version and the step by step code compiles as copied for me)  You should go through carefully and make sure each open brace has a corresponding close brace, or you could recopy the code (remembering to adjust the constants at the top.)

If you copied form the section where each bit of code is explained separately, it would be very easy to miss a close brace.

Let us know how it goes.

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
35 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:

ibgedubo

aogomaeqaza

ureomug

itixuwidouzuv

eilimir

memozupi

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee