Atmel出了一套ASF培训视频,我觉得看着做真不错,可以用ASF编程啦,前提是得有一块Atmel的板子.
我手里有块SAMD21的开发板,那么跟着学吧
视频: ASF设计part1http://v.youku.com/v_show/id_XNjAxNTkwNTQ4.html?from=y1.2-1-105.3.7-1.1-1-1-6
我打开Studio6.2按照视频建立了工程,确怎么也包含不了LED.h.我想应是版本问题,也没有想到更新速度这么地快!!!
我变通了一下.就用管脚控制LED0
按照视频把Delay.h加进,但编译通过了,板子找不到了,我就找到例程下了,好用,我又返回我的工程还是不好用,后来发现芯片选错了,D21J选个D21N.
唉!干什么都得认真啊!!!!
以下是正在运行
程序:
/*
* Include header files for all drivers that have been imported from
* Atmel Software Framework (ASF).
*/
#include <asf.h>
int main (void)
{
system_init();
delay_init();
// Insert application code here, after the board has been initialized.
// This skeleton code simply sets the LED to the state of the button.
while (1) {
port_pin_set_output_level(LED_0_PIN, LED_0_ACTIVE);
delay_ms(500);
port_pin_set_output_level(LED_0_PIN, !LED_0_ACTIVE);
delay_ms(500);
}
}
ASF向导的截图:
|