Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - MOONSHOP03/GXHTC3: GXHTC3 is a straightforward library for reading temperature and humidity data from the GXHTC3 sensor using I2C. Explore the examples to see how easily you can integrate this sensor into your Arduino projects! 🛠️🌡️
Nothing Special   »   [go: up one dir, main page]

Skip to content

GXHTC3 is a straightforward library for reading temperature and humidity data from the GXHTC3 sensor using I2C. Explore the examples to see how easily you can integrate this sensor into your Arduino projects! 🛠️🌡️

License

Notifications You must be signed in to change notification settings

MOONSHOP03/GXHTC3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GXHTC3: Arduino-Compatible Library for Temperature and Humidity Sensing 🌡️💧

Download Releases

Welcome to the GXHTC3 repository! This library allows you to easily interface with the GXHTC3 temperature and humidity sensor using I2C. Whether you are building a weather station, a smart home device, or any other project that requires accurate environmental data, this library simplifies the process of sensor communication and data management.

Table of Contents

  1. Features
  2. Installation
  3. Usage
  4. Examples
  5. Contributing
  6. License
  7. Support

Features

  • I2C Communication: Communicate with the GXHTC3 sensor using the I2C protocol.
  • Easy-to-Use Interface: Simple functions for reading temperature and humidity data.
  • Power Management: Efficient power management to extend battery life in portable applications.
  • Arduino Compatibility: Works seamlessly with Arduino boards.

Installation

To install the GXHTC3 library, follow these steps:

  1. Download the Library: Visit the Releases section to download the latest version of the library.

  2. Add to Arduino IDE:

    • Open the Arduino IDE.
    • Go to Sketch > Include Library > Add .ZIP Library....
    • Select the downloaded ZIP file.
  3. Verify Installation: After installation, you can check if the library is included by navigating to Sketch > Include Library. You should see GXHTC3 in the list.

Usage

To use the GXHTC3 library in your Arduino project, include it at the top of your sketch:

#include <GXHTC3.h>

Initializing the Sensor

Create an instance of the GXHTC3 class and initialize it in the setup() function:

GXHTC3 sensor;

void setup() {
    Serial.begin(9600);
    if (!sensor.begin()) {
        Serial.println("Sensor not found!");
        while (1);
    }
    Serial.println("Sensor initialized successfully.");
}

Reading Data

You can read temperature and humidity data using the following functions:

void loop() {
    float temperature = sensor.readTemperature();
    float humidity = sensor.readHumidity();
    
    Serial.print("Temperature: ");
    Serial.print(temperature);
    Serial.println(" °C");
    
    Serial.print("Humidity: ");
    Serial.print(humidity);
    Serial.println(" %");
    
    delay(2000); // Wait for 2 seconds before the next reading
}

Examples

To help you get started, we have included example sketches in the examples folder. Here are a couple of highlights:

Basic Example

This example shows how to read and display temperature and humidity data:

#include <GXHTC3.h>

GXHTC3 sensor;

void setup() {
    Serial.begin(9600);
    if (!sensor.begin()) {
        Serial.println("Sensor not found!");
        while (1);
    }
}

void loop() {
    float temperature = sensor.readTemperature();
    float humidity = sensor.readHumidity();
    
    Serial.print("Temperature: ");
    Serial.print(temperature);
    Serial.println(" °C");
    
    Serial.print("Humidity: ");
    Serial.print(humidity);
    Serial.println(" %");
    
    delay(2000);
}

Advanced Example

In this example, we will log the data to an SD card. Ensure you have an SD card module connected to your Arduino.

#include <GXHTC3.h>
#include <SD.h>

GXHTC3 sensor;
File dataFile;

void setup() {
    Serial.begin(9600);
    if (!sensor.begin()) {
        Serial.println("Sensor not found!");
        while (1);
    }
    
    if (!SD.begin()) {
        Serial.println("SD card initialization failed!");
        return;
    }
    Serial.println("SD card initialized.");
}

void loop() {
    float temperature = sensor.readTemperature();
    float humidity = sensor.readHumidity();
    
    dataFile = SD.open("data.txt", FILE_WRITE);
    if (dataFile) {
        dataFile.print("Temperature: ");
        dataFile.print(temperature);
        dataFile.print(" °C, Humidity: ");
        dataFile.print(humidity);
        dataFile.println(" %");
        dataFile.close();
    } else {
        Serial.println("Error opening file");
    }
    
    delay(2000);
}

Contributing

We welcome contributions to improve the GXHTC3 library. If you have suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

How to Contribute

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your branch to your fork.
  5. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For support, please check the Releases section for updates and documentation. You can also open an issue in the repository if you encounter any problems.


Thank you for using the GXHTC3 library! We hope it helps you in your projects. For more information, feel free to explore the code and examples provided in this repository. Happy coding!

About

GXHTC3 is a straightforward library for reading temperature and humidity data from the GXHTC3 sensor using I2C. Explore the examples to see how easily you can integrate this sensor into your Arduino projects! 🛠️🌡️

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0