Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

hannon1000 on Building Weather Station. Only First Field is being updated.

$
0
0

I can only update one data field at time. Pls advise. My work flow was create TS channel/fields, add channelID and APIKey info to Arduino sketch, add the code below to sketch. All data is seen on computer monitor.

 

void loop() {

BME280Temp=(bme.readTemperature()*1.8+32);
  ThingSpeak.writeField(myChannelNumber,1,BME280Temp,myWriteAPIKey);
 
  Atemp=(am2315.readTemperature()*1.8+32);
  ThingSpeak.writeField(myChannelNumber,2,Atemp,myWriteAPIKey);
    
  BME280Humi=(bme.readHumidity());
  ThingSpeak.writeField(myChannelNumber,3,BME280Humi,myWriteAPIKey);
 
  Ahumi=(am2315.readHumidity());
  ThingSpeak.writeField(myChannelNumber,4,Ahumi,myWriteAPIKey);
 
  BME280StationPressureMillibars=(bme.readPressure()/100);
  BME280EquivSeaLevelPressureMillibars=(BME280StationPressureMillibars+(16/9.2));
  BME280Press=(BME280EquivSeaLevelPressureMillibars*0.02953);
  ThingSpeak.writeField(myChannelNumber,5,BME280Press,myWriteAPIKey);
 
  Serial.print(BME280Temp,0);
  Serial.print(" F  ");
  Serial.print(Atemp,0);
  Serial.print(" F  ");
  Serial.print(BME280Humi,0);
  Serial.print("%  ");
  Serial.print(Ahumi,0);
  Serial.print("%  ");
  Serial.print(BME280Press,2);
  Serial.println(" InHg");
 
  delay(20000);


Viewing all articles
Browse latest Browse all 1833

Trending Articles