This repository has been archived on 2025-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2bki21/INF/eingabe-dann-move/Freenove_4WD_Car_For_ESP32.h
2024-12-03 09:21:41 +01:00

23 lines
1.0 KiB
C

#ifndef _FREENOVE_4WD_CAR_H
#define _FREENOVE_4WD_CAR_H
#include <Arduino.h>
#include <PCA9685.h>
#define MOTOR_1_DIRECTION 1 //If the direction is reversed, change 1 to -1
#define MOTOR_2_DIRECTION 1 //If the direction is reversed, change 1 to -1
#define MOTOR_3_DIRECTION 1 //If the direction is reversed, change 1 to -1
#define MOTOR_4_DIRECTION 1 //If the direction is reversed, change 1 to -1
void PCA9685_Close_Com_Address(void);//Close the PCA9685 public address
/////////////////////PCA9685 drive area//////////////////////////////////////
void PCA9685_Setup(void); //servo initialization
void Servo_1_Angle(float angle); //Set the rotation parameters of servo 1, and the parameters are 0-180 degrees
void Servo_2_Angle(float angle); //Set the rotation parameters of servo 2, and the parameters are 0-180 degrees
void Servo_Sweep(int servo_id, int angle_start, int angle_end);//Servo sweep function;
void Motor_Move(int m1_speed, int m2_speed, int m3_speed, int m4_speed);//A function to control the car motor
#endif