Seeed-Studio / Grove_Temper_Humidity

Grove_Temper_Humidity based on TH02 & TH06
MIT License
9 stars 13 forks source link

'TH02' was not declared in this scope #8

Open little-dave95 opened 2 years ago

little-dave95 commented 2 years ago

Hi,

I have an issue with this Sketch:

Arduino: 1.8.19 (Mac OS X), Board: "Arduino Uno WiFi Rev2, ATMEGA328"

'TH02' was not declared in this scope....

I'm quite new to coding so I don't know what else you need....

here is the full sketch...

include

include "Arduino.h"

include "Wire.h"

void setup() { Serial.begin(9600); // start serial for output Serial.println("TH02_dev demo by seeed studio\n"); / Power up,delay 150ms,until voltage is stable / delay(150); / Reset HP20x_dev / TH02.begin(); delay(100); / Determine TH02_dev is available or not / Serial.println("TH02_dev is available.\n"); } void loop() {

float temper = TH02.ReadTemperature(); Serial.println("Temperature: "); Serial.print(temper); Serial.println("C\r\n"); float humidity = TH02.ReadHumidity(); Serial.println("Humidity: "); Serial.print(humidity); Serial.println("%\r\n"); delay(1000);

}

imamnurby commented 2 years ago

I think you can add TH02_dev TH02; before void setup()

*edit due to grammar

lakshanthad commented 2 years ago

I think you can add TH02_dev TH02; before void setup()

*edit due to grammar

Did this solution work for you @little-dave95? I am going to close this issue if that is okay.