commit
445b61d0cc
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
/build/
|
solar_panel.X/build/
|
||||||
/debug/
|
solar_panel.X/debug/
|
||||||
/dist/
|
solar_panel.X/dist/
|
@ -43,7 +43,9 @@
|
|||||||
|
|
||||||
#include "mcc_generated_files/mcc.h"
|
#include "mcc_generated_files/mcc.h"
|
||||||
#include "lcd/lcd.h"
|
#include "lcd/lcd.h"
|
||||||
|
#include "measure.h"
|
||||||
|
|
||||||
|
#define MAX_COL 16
|
||||||
/*
|
/*
|
||||||
Main application
|
Main application
|
||||||
*/
|
*/
|
||||||
@ -53,6 +55,7 @@ void main(void)
|
|||||||
SYSTEM_Initialize();
|
SYSTEM_Initialize();
|
||||||
|
|
||||||
Lcd_Init();
|
Lcd_Init();
|
||||||
|
adc_init();
|
||||||
|
|
||||||
// If using interrupts in PIC18 High/Low Priority Mode you need to enable the Global High and Low Interrupts
|
// If using interrupts in PIC18 High/Low Priority Mode you need to enable the Global High and Low Interrupts
|
||||||
// If using interrupts in PIC Mid-Range Compatibility Mode you need to enable the Global and Peripheral Interrupts
|
// If using interrupts in PIC Mid-Range Compatibility Mode you need to enable the Global and Peripheral Interrupts
|
||||||
@ -72,29 +75,19 @@ void main(void)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
uint16_t value;
|
|
||||||
|
|
||||||
value = ADC_GetConversion(voltage);
|
uint16_t valueV = measure_voltage();
|
||||||
char* msg;
|
uint16_t valueI = measure_current(offsetCurrent);
|
||||||
sprintf(msg, "%i", value);
|
|
||||||
|
|
||||||
|
char msg[MAX_COL+1];
|
||||||
|
//LCD_2x16_WriteCmd(0x01); // clear display
|
||||||
|
|
||||||
|
snprintf(msg, MAX_COL+1, "U = %4i [mV] ", valueV);
|
||||||
LCD_2x16_WriteMsg(msg,0);
|
LCD_2x16_WriteMsg(msg,0);
|
||||||
|
|
||||||
|
snprintf(msg, MAX_COL+1, "I = %4i [uA] ", valueI);
|
||||||
|
LCD_2x16_WriteMsg(msg,1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
LCD_2x16_WriteMsg("TURBOPUTE",0);
|
|
||||||
LCD_2x16_WriteMsg("bip ",1);
|
|
||||||
for(uint32_t i = 0; i<100000; i++)
|
|
||||||
{}
|
|
||||||
LCD_2x16_WriteMsg("boup",1);
|
|
||||||
for(uint32_t i = 0; i<100000; i++)
|
|
||||||
{}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user