Skip to content

Add ASAIR AHT30 Temperature and Humidity Sensor#792

Merged
mattnite merged 2 commits intoZigEmbeddedGroup:mainfrom
andreacoradi:AHT30
Dec 27, 2025
Merged

Add ASAIR AHT30 Temperature and Humidity Sensor#792
mattnite merged 2 commits intoZigEmbeddedGroup:mainfrom
andreacoradi:AHT30

Conversation

@andreacoradi
Copy link
Contributor

Example usage:

    // Pass i2c device to driver to create sensor instance
    var aht30 = try AHT30.init(i2c_device.i2c_device(), @enumFromInt(0x38));

    // Wait for 5ms after the VDD of the sensor is powered on
    time.sleep_ms(5);
    while (true) {
        try aht30.update_readings();
        time.sleep_ms(80);
        const reading = try aht30.read_data();
        std.log.info("Temp: {d:0.2}°C {d:0.2}°F, Relative Humidity: {d:0.2}%", .{ reading.temperature_c, AHT30.c_to_f(reading.temperature_c), reading.relative_humidity });
        time.sleep_ms(1000);
    }
}

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Lint Results

Found 28 issues on changed lines in 7 files:

  • core/src/cpus/cortex_m.zig: 1 issue
  • modules/bounded-array/src/bounded_array.zig: 18 issues
  • port/stmicro/stm32/src/hals/STM32F103/timer.zig: 3 issues
  • port/stmicro/stm32/src/hals/STM32F303.zig: 1 issue
  • port/stmicro/stm32/src/hals/STM32F303/i2c.zig: 3 issues
  • sim/aviron/src/lib/bus.zig: 1 issue
  • tools/linter/src/main.zig: 1 issue
ℹ️ Additional issues on unchanged lines
The following 73 issue(s) exist but are not on lines changed in this PR:

build.zig:405: TODO style comments need to have a linked microzig issue on the same line.
build.zig:649: TODO style comments need to have a linked microzig issue on the same line.
build.zig:689: TODO style comments need to have a linked microzig issue on the same line.
build.zig:705: TODO style comments need to have a linked microzig issue on the same line.
core/src/cpus/cortex_m.zig:40: TODO style comments need to have a linked microzig issue on the same line.
core/src/cpus/cortex_m.zig:46: TODO style comments need to have a linked microzig issue on the same line.
core/src/cpus/cortex_m.zig:51: TODO style comments need to have a linked microzig issue on the same line.
core/src/cpus/cortex_m.zig:52: TODO style comments need to have a linked microzig issue on the same line.
core/src/cpus/cortex_m.zig:665: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:84: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:114: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:148: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:161: TODO style comments need to have a linked microzig issue on the same line.
drivers/wireless/cyw43/bus.zig:101: TODO style comments need to have a linked microzig issue on the same line.
drivers/wireless/cyw43/bus.zig:107: TODO style comments need to have a linked microzig issue on the same line.
drivers/wireless/cyw43/runner.zig:44: TODO style comments need to have a linked microzig issue on the same line.
drivers/wireless/cyw43/runner.zig:79: TODO style comments need to have a linked microzig issue on the same line.
drivers/wireless/cyw43/runner.zig:102: TODO style comments need to have a linked microzig issue on the same line.
examples/stmicro/stm32/build.zig:18: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/src/hal.zig:43: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/src/hal.zig:129: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/src/hal/drivers.zig:478: TODO style comments need to have a linked microzig issue on the same line.
port/raspberrypi/rp2xxx/src/hal/pio/assembler/encoder.zig:369: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/boards/STM32L476DISCOVERY.zig:18: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/generate.zig:253: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/DMA.zig:3: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/DMA.zig:56: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/DMA.zig:82: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/DMA.zig:113: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/DMA.zig:125: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:96: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:138: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:285: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:286: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:304: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:372: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:397: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:405: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:419: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:434: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:447: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:474: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:567: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:583: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:595: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:666: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:682: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:825: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/adc.zig:878: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/i2c.zig:256: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/i2c.zig:410: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/spi.zig:28: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/time.zig:23: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/time.zig:24: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/time.zig:25: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/time.zig:50: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/uart.zig:1: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/uart.zig:2: TODO style comments need to have a linked microzig issue on the same line.
port/stmicro/stm32/src/hals/STM32F103/uart.zig:117: TODO style comments need to have a linked microzig issue on the same line.
tools/linter/src/main.zig:62: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/Database.zig:115: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/Database.zig:1195: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/Database.zig:2074: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:417: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:522: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:675: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:713: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:813: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:1053: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:1055: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/gen.zig:1131: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/main.zig:143: TODO style comments need to have a linked microzig issue on the same line.
tools/regz/src/output_tests.zig:156: TODO style comments need to have a linked microzig issue on the same line.

⚠️ Could not attach inline comments due to an error.

@github-actions github-actions bot dismissed their stale review December 27, 2025 13:57

Updating with new lint results

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Lint Results

ℹ️ Additional issues on unchanged lines
The following 4 issue(s) exist but are not on lines changed in this PR:

drivers/framework.zig:86: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:116: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:150: TODO style comments need to have a linked microzig issue on the same line.
drivers/framework.zig:163: TODO style comments need to have a linked microzig issue on the same line.

@mattnite mattnite merged commit 106b28f into ZigEmbeddedGroup:main Dec 27, 2025
48 checks passed
@andreacoradi andreacoradi deleted the AHT30 branch December 28, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants