This commit is contained in:
2024-10-08 16:51:36 +03:00
parent 53bf72d071
commit 08b99d8ec2
9 changed files with 287 additions and 102 deletions

View File

@ -35,3 +35,16 @@ void SetServo(uint8_t channel, uint8_t angel)
HAL_I2C_Master_Transmit(&hi2c1, (PCA9685_ADRESS << 1), bufer, 5, 10);
}
void SetServoOFF(uint8_t channel)
{
uint8_t bufer[5];
bufer[0] = 6 + channel*4; //channel register adress
bufer[1] = 0; //start time for "on" Lowbyte (0..4095)
bufer[2] = 0; //start time for "on" HIbyte
bufer[3] = 0&0xFF; //start time for "off" Lowbyte (0..4095)
bufer[4] = 0>>8;; //start time for "off" HIbyte
HAL_I2C_Master_Transmit(&hi2c1, (PCA9685_ADRESS << 1), bufer, 5, 10);
}