This commit is contained in:
2026-05-21 09:08:44 +05:30
parent ffe400f80f
commit e64d0bf13f
3 changed files with 116 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
#include<stdio.h>
#include "DrvADC.h"
#include "Seven_Segment.h"
#include "NUC1xx.h"
#include "Driver\DrvSYS.h"
#include "LCD_Driver.h"
int32_t main(void){
uint16_t value;
char text[16];
UNLOCKREG();
SYSCLK->PWRCON.XTL12M_EN = 1;
SYSCLK->CLKSEL0.HCLK_S = 0;
LOCKREG();
Initial_panel();
clr_all_panel();
print_lcd(0, "variable resistor");
DrvADC_Open(
ADC_SINGLE_END,
ADC_SINGLE_OP,
0X80,
INTERNAL_HCLK,
1
);
while(1){
DrvADC_StartConvert();
while(DrvADC_IsConversionDone()==FALSE);
value = ADC->ADDR[7].RSLT & 0xFFF;
sprintf(text, "value: %d", value);
print_lcd(1, text);
}
}