帮我解释一下这个流水灯程序~程序运行结果是8个灯间歇性亮灭,就是先全亮,然后慢慢变暗,再亮,再慢慢变#include #define uint unsigned int void delay1(uint t);void jianliang();void main (void){while (1) {jianliang();
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/15 12:11:04
![帮我解释一下这个流水灯程序~程序运行结果是8个灯间歇性亮灭,就是先全亮,然后慢慢变暗,再亮,再慢慢变#include #define uint unsigned int void delay1(uint t);void jianliang();void main (void){while (1) {jianliang();](/uploads/image/z/10085391-63-1.jpg?t=%E5%B8%AE%E6%88%91%E8%A7%A3%E9%87%8A%E4%B8%80%E4%B8%8B%E8%BF%99%E4%B8%AA%E6%B5%81%E6%B0%B4%E7%81%AF%E7%A8%8B%E5%BA%8F%7E%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E7%BB%93%E6%9E%9C%E6%98%AF8%E4%B8%AA%E7%81%AF%E9%97%B4%E6%AD%87%E6%80%A7%E4%BA%AE%E7%81%AD%2C%E5%B0%B1%E6%98%AF%E5%85%88%E5%85%A8%E4%BA%AE%2C%E7%84%B6%E5%90%8E%E6%85%A2%E6%85%A2%E5%8F%98%E6%9A%97%2C%E5%86%8D%E4%BA%AE%2C%E5%86%8D%E6%85%A2%E6%85%A2%E5%8F%98%23include+%23define+uint+unsigned+int+void+delay1%28uint+t%29%3Bvoid+jianliang%28%29%3Bvoid+main+%28void%29%7Bwhile+%281%29+%7Bjianliang%28%29%3B)
帮我解释一下这个流水灯程序~程序运行结果是8个灯间歇性亮灭,就是先全亮,然后慢慢变暗,再亮,再慢慢变#include #define uint unsigned int void delay1(uint t);void jianliang();void main (void){while (1) {jianliang();
帮我解释一下这个流水灯程序~程序运行结果是8个灯间歇性亮灭,就是先全亮,然后慢慢变暗,再亮,再慢慢变
#include
#define uint unsigned int
void delay1(uint t);
void jianliang();
void main (void)
{
while (1)
{
jianliang();
}
}
void delay1(uint t)
{
while(--t);
}
void jianliang()
{
unsigned int CYCLE=600,PWM_LOW=0;
P2=0xff;
for(PWM_LOW=1; PWM_LOW0;PWM_LOW--)
{
P2=0x00;
delay1(CYCLE-PWM_LOW);
P2=0xff;
delay1(PWM_LOW);
}
P2=0xff;
}
帮我解释一下这个流水灯程序~程序运行结果是8个灯间歇性亮灭,就是先全亮,然后慢慢变暗,再亮,再慢慢变#include #define uint unsigned int void delay1(uint t);void jianliang();void main (void){while (1) {jianliang();
利用对亮和灭延迟时间的不同,加上视觉暂留就有逐渐变化的效果
for(PWM_LOW=1; PWM_LOW