实验原理:
STM32内部集成三个12位ADC,GMT43的所有电源经过电阻分压接
入到ADC的输入通道内,输入电流经过高端电流检测芯片ZXCT1009F输入
到ADC的输入通道内,从而实现电源监控功能。
示例截图:
源代码下载链接:
链接:http://pan.baidu.com/s/1kVBmcqN 密码:rxhp
GMT43购买链接:
核心代码:
static void frame_process(void)
{
int i; GUI_CURSOR_Show();
WM_SetCreateFlags(WM_CF_MEMDEV);
GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, , ); while(){
if(power_flag == ){
power_flag = ;
for(i = ;i < ;i++){
adc.read(i);
memset(power_buffer[i],,sizeof(power_buffer[i]));
}
sprintf(power_buffer[],"%.2f",adc.value[] * );
sprintf(power_buffer[],"%.2f",adc.value[] * );
sprintf(power_buffer[],"%.2f",adc.value[] * );
sprintf(power_buffer[],"%.2f",adc.value[] * );
for( i = ; i < ; i++){
EDIT_SetText(h_edit[i],power_buffer[i]);
}
}
GUI_Exec();
}
}