Code Monkey home page Code Monkey logo

azuresphereledlibs's Introduction

AzureSphereLedLibs

Led driver libraries for Azure Sphere

Supported Features

  • Driving Rgb-Leds and and simple rgb-led strips with PWM
  • Driving Apa102 and similar leds using SPI

Wiring

Single rgb led

  1. Connect the color channels to 3 pwm-enabled gpio pins
  2. Connect the leds ground to a ground pin

Rgb led strip

  1. Connect 3 pwm enabled gpio-pins to your booster circuit
  2. Connect the boosters output to your led-strip
  3. Connect the boosters positive input to a power-supply
  4. Connect the the boosters ground to the power supply and to the Sphere's ground

Apa 102 leds

  1. Connect the SPI-CLK pin to the led's CI connection
  2. Connect the SPI-MOSI pin to the led's DI connection
  3. Connect the led's 5v to a power supply
  4. Connect the led's GND to the power supply and to Sphere's GND pin

Usage

Use the provided samples or start from scratch

Pwm

  1. Find the controller_id and the ids of the pins you connected to
  2. Add "Pwm": [ "PWM-CONTROLLER-{yourControllerId}" ] to the applications manifest capabilities
  3. Add the setup and teardow methods:
SetupPwm(unsigned int controller_id, uint32_t redPin, uint32_t greenPin, uint32_t bluePin);
Teardown();
  1. Set the desired color by using the color-srtruct or by setting the values directly
SetColor(struct Color color);
SetColorFromInt(int red, int green, int blue);
SetColorFromBytes(uint8_t red, uint8_t green, uint8_t blue);

Apa 102

  1. Find the interface_id and the chipselct_id of the interface you used
  2. Add "SpiMaster": [ "ISU{interface_id}" ] to the applications manifest capabilities
  3. Add the setup and teardow methods:
SetupApa102(int interfaceId, int chipSelectId);
Teardown();

4.1. Set the whole strip to a solid color: SetSolid(struct ColorWithBrightness color, int length);

4.2. Set the whole strip to custom colors: SetCustom(struct ColorWithBrightness *color, int length);

4.3. Stream colors to the leds, from the first to the last:

PrepareForStreaming();
while(?)
{
  AppendColor(struct ColorWithBrightness color);
}
FinishStreaming();

azuresphereledlibs's People

Contributors

zyklop avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

kwest-wrd

azuresphereledlibs's Issues

List repo in Azure Sphere Gallery

We are delighted that you are using the Azure Sphere platform.
As the community of users grow, we wanted to collate a list of open-source projects that utilizes the Azure Sphere platform.
The aim of this list is to point users to open-source work from other members in the community. Especially where there are examples
of interfacing the Azure Sphere platform with external hardware modules and peripherals, like this repo.
This would be very beneficial to future projects.
We would like to point to this repo in a list on the Azure Sphere Gallery on GitHub.

Please let us know if you would like to not be included in this list.
Thank you for your invaluable contribution, looking forward to more exciting Azure Sphere based projects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.