/********* Pleasedontcode.com **********

	Pleasedontcode thanks you for automatic code generation! Enjoy your code!

	- Terms and Conditions:
	You have a non-exclusive, revocable, worldwide, royalty-free license
	for personal and commercial use. Attribution is optional; modifications
	are allowed, but you're responsible for code maintenance. We're not
	liable for any loss or damage. For full terms,
	please visit pleasedontcode.com/termsandconditions.

	- Project: Servo Control
	- Source Code compiled for: ESP32 DevKit V1
	- Source Code created on: 2024-05-02 18:26:24

********* Pleasedontcode.com **********/

/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
	/* stream video over webserver, save videos and pic */
	/* to sd card, pan camera using the servo to follow */
	/* objects also do face recognition, set video */
	/* resolutio to 480p */
/****** END SYSTEM REQUIREMENTS *****/

/****** DEFINITION OF LIBRARIES *****/
#include <Deneyap_Servo.h> // https://github.com/deneyapkart/deneyap-servo-arduino-library

/****** FUNCTION PROTOTYPES *****/
void setup(void);
void loop(void);
void updateOutputs(void);

/***** DEFINITION OF PWM OUTPUT PINS *****/
const uint8_t sg90_Servomotor_PWMSignal_PIN_D4 = 4;

/***** DEFINITION OF OUTPUT RAW VARIABLES *****/
/***** used to store raw data *****/
uint8_t sg90_Servomotor_PWMSignal_PIN_D4_rawData = 0;

/***** DEFINITION OF OUTPUT PHYSICAL VARIABLES *****/
/***** used to store data after characteristic curve transformation *****/
float sg90_Servomotor_PWMSignal_PIN_D4_phyData = 0.0;

/****** DEFINITION OF LIBRARIES CLASS INSTANCES*****/
Servo myservo; // Servo object instance from Deneyap Servo library

void setup(void)
{
    // put your setup code here, to run once:
    pinMode(sg90_Servomotor_PWMSignal_PIN_D4, OUTPUT);

    myservo.attach(9); // Attaching servo motor to pin 9

    // Additional setup for system requirements
    // Initialize SD card for saving videos and pictures
    // Set video resolution to 480p
    // Perform face recognition setup
}

void loop(void)
{
    // put your main code here, to run repeatedly:
    updateOutputs(); // Refresh output data

    // Additional code for system requirements
    // Stream video over webserver
    // Pan camera using the servo to follow objects
}

void updateOutputs(void)
{
    analogWrite(sg90_Servomotor_PWMSignal_PIN_D4, sg90_Servomotor_PWMSignal_PIN_D4_rawData);
}
