[PYTHON] AI Autonomous Driving Radio Controlled Car Proto (2-2 Dimming Turn Signal)

Introduction

Although it is a PWM controller used for servo control, it can also be used to control LED brightness. I used this to simulate a Mazda 3 turn signal (although it's hard to understand except for Mazda fans ...).

Premise

--Device: HiLetgo PCA9685 --Library: Adafruit Python PCA9685

About LED PWM control

The PWM controller can set the frequency and timing from High to Low. For example, the figure (a) below looks relatively bright because the period of High is longer than that of (b). If it is always High, it will be the maximum brightness, and if it is always Low, it will be off.

pwm.png

Installation

sudo apt-get install git build-essential python3-dev
cd ~
git clone https://github.com/adafruit/Adafruit_Python_PCA9685.git
cd Adafruit_Python_PCA9685
sudo python3 setup.py install

Implementation

The PWM frequency is 57.8Hz due to servo control, the blinking frequency is 1.5Hz, and it looks like it when the brightness is changed every 30 steps with 4096 gradations.

result

Link to table of contents page

Table of Contents

Recommended Posts

AI Autonomous Driving Radio Controlled Car Proto (2-2 Dimming Turn Signal)