Solar panel
|
Main is in two part. First for setup everything Second for loop on measure and set duty cycle for PWM. More...
Go to the source code of this file.
Macros | |
#define | MAX_COL 16 |
columns for lcd screen (and 2 rows) | |
Functions | |
void | main (void) |
Main is in two part. First for setup everything Second for loop on measure and set duty cycle for PWM.
Definition in file main.c.
void main | ( | void | ) |
SETUP FUNCTIONS:
Initialize the system with all mcc default configs
Initialize lcd screen
Initialize adc for measures
Initialize all specific modbus function
Enable the Global Interrupts
Enable the Peripheral Interrupts
Initialize offset current.
The goal it's to remove the offset due to the electronics parts
create a char array for display on lcd (with space for '\0')
LOOP MAIN PROGRAM:
Get the measure and save it and the appropriate register
Print on the first row of the lcd the Voltage
Print on the second row of the lcd the current
Write the duty cycle for pwm from the appropriate register