在线时间13 小时
UID212138
注册时间2008-5-25
NXP金币0
TA的每日心情 | 奋斗 2019-6-9 17:24 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
注册会员

- 积分
- 178
- 最后登录
- 2019-7-18
|
<div class="t_fsz" style="word-wrap: break-word; margin: 0px; padding: 0px; min-height: 100px; color: rgb(34, 34, 34); font-family: sans-serif; line-height: 12.413792610168457px; background-color: rgb(238, 238, 238); ">[table] [tr] [td] MCU KEA64 开发环境cw10.5
1,原理图如图:
A/D配置代码如下:
/***********************************************************************************************
*
* @brief main() - Program entry function
* @param none
* @return none
*
************************************************************************************************/
int main(void)
{
UINT32 counter = 0;
UINT8 adc_value = 0;
Clk_Init(); /* Configure clocks to run at 20 Mhz */
GPIO_Init(); /* Configure button pins as inputs and LED pins as outputs */
ADC_Init(3,EIGTH_BIT); /* Configure ADC channel 3 in 8-bit resolution mode */
for(;;) {
counter++;
adc_value=ADC_Read(3); /* Read ADC value from channel 3 */
/* Display ADC value in LED0, LED1, LED2 and LED3*/
adc_value = adc_value >> 4;
GPIOA_PSOR |=adc_value
|
|