Library MSP430 PCA9685, Bluetooth module HC-05

posted in: Microcontroller | 0

16 Chanel PWM controller circuit PCA9685 can output 16 PWM pulses from 16 different ports simultaneously through I2C communication using IC PCA9685, can control 16 servos simultaneously. Used as robot arm, spider robot…

Figure 1. Wiring diagram

You can replace the HC-05 with any UART interface such as arduino, esp, ..

To control Servo you use this command.

PCA9685_u16ChangeServoDegree_MG90(góc,servo thứ (0-15));

To compare the signal read from the HC-05 and execute the command you edit this code and add the function you need to execute.

 __bis_SR_register(LPM0_bits); //Chờ để đọc lệnh, không xóa dòng này
                    //Đọc và so sánh lệnh
                    if (rxBuffer == '1') P1OUT |= 0x01; //rxBuffer là dữ liệu đọc được từ HC-05
                    if (rxBuffer == '0') P1OUT &= ~0x01;    // P1.0




Download

Dự án demo

Leave a Reply

Your email address will not be published.