Good afternoon everybody. I'm having trouble compiling my Photon 2 with the ThingSepeak libraries. Before I had Photon 1 and it compiled normally. Now that I have migrated to Photon 2 I get the following error: "ThingSpeak.h: No such file or directory". Any help is welcome.
Hi, where are you compiling, and can you show us the code?
Mostly your error indicates that you are missing a line like this at the top of the program:
#include "ThingSpeak.h"
or:
#include "lib/ThingSpeak.h"
A post was split to a new topic: Error Compilation Photon 2
Goodnight. Here's the code I'm trying to compile and it's showing an error:Preformatted text
#include "ThingSpeak.h"
TCPClient client;
/*
*****************************************************************************************
**** Visit https://www.thingspeak.com to sign up for a free account and create
**** a channel. The video tutorial http://community.thingspeak.com/tutorials/thingspeak-channels/
**** has more information. You need to change this to your channel, and your write API key
**** IF YOU SHARE YOUR CODE WITH OTHERS, MAKE SURE YOU REMOVE YOUR WRITE API KEY!!
*****************************************************************************************/
unsigned long myChannelNumber = 31461;
const char * myWriteAPIKey = "LD79EOAAWRVYF04Y";
void setup() {
ThingSpeak.begin(client);
}
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading
// On Particle: 0 - 4095 maps to 0 - 3.3 volts
float voltage = sensorValue * (3.3 / 4095.0);
// Write to ThingSpeak. There are up to 8 fields in a channel, allowing you to store up to 8 different
// pieces of information in a channel. Here, we write to field 1.
ThingSpeak.writeField(myChannelNumber, 1, voltage, myWriteAPIKey);
delay(20000); // ThingSpeak will only accept updates every 15 seconds.
}