Quantcast
Channel: ThingSpeak IoT Community - Forum: Arduino
Viewing all articles
Browse latest Browse all 172

rw950431 on Can't upload serially recieved data to thingspeak

$
0
0

Are you sure you are reading valid values from the serial port?  I wonder if you are sending blanks.

What happens if you add a 3rd constant value in your read loop to make sure you are sending at least one known value.

Eg

while (mySerial.available()>0)
  {
      int sensorValue = mySerial.read();
      ThingSpeak.setField(1,sensorValue);
      ThingSpeak.setField(2,mySerial.read());

      ThingSpeak.setField(3,10);
                                                                                 //   int myValue = sensorValue(sensorValue.toInt);
                                                                       // int sensorValue = 10;
       ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
       delay(15000);
       Serial.print("Sensor data=");
       delay(10);
       Serial.println(sensorValue);
 
 }


Viewing all articles
Browse latest Browse all 172

Trending Articles