Node6 Controlling LED Brightness

This is the simple example of setting brightness of LED.

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

Both cameras must show LED blinking in given periods of time.

FAQ

en/iot-open/remotelab/sut/color/b1.txt · Last modified: 2020/07/20 09:00 by 127.0.0.1
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