This is an old revision of the document!


B4: Handling LED brightness using PWM via I2C controller

This is the simple example of setting brightness of LED using PWM controller.

Target group

This hands-on lab guide is intended for the Beginners.

Prerequisites

The user needs to know: Basic knowledge of ESP8266 NodeMCU v.2. ESP8266 Arduino programming, Basic knowledge of I2C Interface. Basic knowledge of I2C programming using Arduino I2C library.

Scenario

All important information including the address of devices is enclosed in the description of the laboratory. In that scenario, the user should write a program in Arduino platform which turns on and off LEDs for the specified time 15 seconds. LED brightness can be controlled by setting variable “level” from 0 to 4095.

Result

As a result user can control in cameras program execution.

Start

In the beginning, both cameras must show that all LEDs are off. Steps

Step 1

First load an example project, include appropriate libraries and declare variable ledDriver #include <Wire.h> #include <PCA9685.h>

PCA9685 ledDriver;

Step 2

Please scan I2C bus and check if PWM controller is present.

Step 3

Write a programm which: Turn LED1 placed on dark side to warm-white fully on for 15 seconds Turn LED1 off Turn LED1 to cold-white fully on for 15 seconds Turn lED1 off Turn LED2 placed on bright side to warm-white fully on for 15 seconds Turn LED2 off Turn LED2 to cold-white fully on for 15 seconds Turn lED2 off ledDriver.setLEDDimmed(number,level)

Step 4

Repeat step 3 ten times.

Result validation

Provide some result validation methods, for self assesment.

FAQ

This section is to be extended as new questions appear.
When using the printed version of this manual please refer to the latest online version of this document to obtain the valid and up-to-date list of the FAQ. Provide some FAQs in the following form:
Question?: Answer.

en/iot-open/remotelab/sut/color/b4.1566933551.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0