STM8--ADC-CHANGE
代码说明:
在许多的单片机应用系统中,都需要A/D转换器,将模拟量转换成数字量。在STM8单片机中,提供的是10位的A/D,通道数随芯片不同而不同,少的有4个通道,多的则有16个通道。 下面的实验程序首先对A/D输入进行采样,然后将采样结果的高8位(丢弃最低的2位),作为延时参数去调用延时子程序,然后再去驱动LED控制信号。因此不同的采样值,决定了LED的闪烁频率。当旋转ST三合一开发板上的电位器时,可以看到LED的闪烁频率发生变化。 (In many microcontroller applications require the A/D converter to convert analog into digital. STM8 microcontroller, providing a 10-bit A/D channel number with the chip, little has four channels, more than 16 channels. The following experimental procedure first sampling A/D input, then the sampling results 8 (drop the lowest 2), as the delay parameter to call the delay subroutine, and then go drive LED control signal. Different sampling values, the LED flashing frequency. When the potentiometer rotation ST triple development board, you can see the LED flashing frequency change.)
下载说明:请别用迅雷下载,失败请重下,重下不扣分!