CCCPaste

Automated Parking rev_01

/********* 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: Automated Parking
	- Source Code compiled for: Arduino Uno
	- Source Code created on: 2024-03-22 06:01:02

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

/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
	/* automated parking system with 4 ir and servo. With */
	/* three parking slots and the gate will open if */
	/* there is any parking slot is left */
/****** END SYSTEM REQUIREMENTS *****/

/****** DEFINITION OF LIBRARIES *****/
#include 
#include 
#include 

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

/***** DEFINITION OF PWM OUTPUT PINS *****/
const uint8_t servoPin = 3;

/***** DEFINITION OF I2C PINS *****/
const uint8_t i2cPinSDA = A4;
const uint8_t i2cPinSCL = A5;
const uint8_t i2cSlaveAddress = 90;

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

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

/****** DEFINITION OF LIBRARIES CLASS INSTANCES *****/
Servo servoMotor;
Adafruit_MLX90614 mlx;

void setup(void)
{
    // put your setup code here, to run once:
    pinMode(servoPin, OUTPUT);
    servoMotor.attach(servoPin);

    Wire.begin();
    mlx.begin(i2cSlaveAddress);

    // Add your code for the automated parking system here
}

void loop(void)
{
    // put your main code here, to run repeatedly:

    updateOutputs(); // Refresh output data

    // Add your code for the automated parking system here
}

void updateOutputs()
{
    servoMotor.write(servoRawData);
}

/****** SYSTEM REQUIREMENTS *****/
/****** SYSTEM REQUIREMENT 1 *****/
    /* Automated parking system with 4 IR sensors and a servo */
    /* Three parking slots */
    /* The gate will open if there is any parking slot left */
/****** END SYSTEM REQUIREMENTS *****/