D
D
DYm00n2016-03-06 19:14:23
Arduino
DYm00n, 2016-03-06 19:14:23

Reworking the sketch to send data to thingspeak instead of port monitor. How?

The essence of the problem - there is some kind of sketch, for example this

int sensorPin = A0;            // устанавливаем входную ногу для АЦП
unsigned int sensorValue = 0;  // цифровое значение фоторезистора
void setup()
{
  pinMode(13, OUTPUT);
  Serial.begin(9600);        // старт последовательного вывода данных (для тестирования)
}
void loop()
{
  sensorValue = analogRead(sensorPin);  // считываем значение с фоторезистора
  Serial.print(sensorValue, DEC);     // вывод данных с фоторезистора (0-1024)
  Serial.println("");
  delay(500); 
}

you need to redo it so that it sends data once every 5 minutes, for example, to thingspeak. I am a noob at writing sketches, so I'm asking for help. If my head works correctly, then you first need to log in, enter your KEY, and only then, somehow, redirect the data not to the port monitor, but to thingspeak

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
geopunk, 2016-03-13
@geopunk

What are you going to send through: ethernet, wi-fi, gprs? The given sketch has nothing to do with sending data to the server, unless there is a program on the PC that will take data from the com port and send it, then nothing needs to be redone.
For esp8266, I just recently sketched a sketch, it seems to work fine. You only need to change the wi-fi network and apikey to your name and password.
https://drive.google.com/file/d/0B1q6kXHFzFBuSTh0R...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question