Skip to content
Kitki30Public

About

Awinic AW9364 Driver for ESP-IDF v6.1

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

AW9364 Library

PlatformIO Registry

Simple driver for AW9364 LED controller, used in T-Embed CC1101's

Instalation

Requires C++ compiler.

PlatformIO install

Add following line into your lib_deps in platformio.ini

lib_deps = 
    kitki30/aw9364@^1.0.1

Standard install

Copy this repo to your libraries folder (e.g. /lib/aw9364)

Paste following code into your main CMakeLists.txt

# aw9364 lib
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/lib/aw9364")

Replace path with aw9364 lib directory location

Usage example

#include "aw9364.hpp"
#include "soc/gpio_num.h"

AW9364 aw9364;
aw9364.init((gpio_num_t)21); // Specify your GPIO number here, needs to have output capabilities

for (int i = 0; i < 16; i++) {
    aw9364.set_level(i); // Set light level to i, light levels can be 0-16, where 0 is disabled, 1 is the brightest level, 16 is the darkest
    ESP_LOGI(TAG, "Current light level: %d", aw9364.get_level()); // Get current light level
    vTaskDelay(300);
}
aw9364.deinit(); // Deinits GPIO pin and disables light

Used SensorLib as a reference, awinic docs are really bad

About

Awinic AW9364 Driver for ESP-IDF v6.1

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages