我的LED灯都会亮然而我做的例题是马老师书的demo10-1
本帖最后由 fx8125 于 2013-8-20 15:41 编辑#include <mega48.h>
void main(void)
{
DDRD.6 = 1;
PORTD.6 = 1;
ACSR = 0x40;
while (ACO)
{
if (ACO)
PORTD.6 = 0;
else
PORTD.6 = 1;
}
}
请各位高手帮我看看我看马老师书,可是我用48不是16,IF那边ACSR.5不能用,所以我用ACO。
外部都改成跟马老师一样,只是他还是永远亮就算我调超过片内基准电压1.22超过很多。
如果有用马老师书的人请帮我看看. 本帖最后由 guew 于 2013-8-19 22:54 编辑
你是来自外国的留学生吗? 对阿我是来自外国留学生 to replace the ‘ACO‘ in while with ’1‘,and ‘ACO’ in if with‘(ACSR >> 5)&0x01’. 本帖最后由 guew 于 2013-8-20 01:40 编辑
Since the bit of ACO is macro defined by 5 in the header file which comes with CVAVR. Upon what you done in the coding, the program sucks in the if statement forever, which explains led nonresponding. thanks you where are you from, Pakistan? wait, more likely from non-english speaking country. fx8125 发表于 2013-8-20 01:40 static/image/common/back.gif
thanks you
thanks you? 谢死你 ? {:lol:} >>the program sucks in the if statement forever,
文法上: the program stuck in the if statement forever...
(动词verb): stick, sticks, sticking, stuck
用 sucks 也可,不过表达的意思大为不同,且须改为:
the program sucks (running | executing | looping | circulating) in the if statement forever.
guew 发表于 2013-8-20 01:49 static/image/common/back.gif
wait, more likely from non-english speaking country.
来自一个文字中不使用标点符号的国家{:titter:}
页:
[1]