查看: 2326|回复: 0

AVR Xplain LED例程1

[复制链接]
  • TA的每日心情
    奋斗
    2019-12-1 10:07
  • 签到天数: 1617 天

    连续签到: 1 天

    [LV.Master]伴坛终老

    发表于 2015-4-16 22:05:06 | 显示全部楼层 |阅读模式
    分享到:
    AVR Xplain 开发板的LED例程1,MCU型号是ATxmega128A1 。
    1. #ifndef F_CPU
    2. /*! \brief Define default CPU frequency, if this is not already defined. */
    3. #define F_CPU 2000000UL
    4. #endif

    5. #include <avr/io.h>
    6. #include <util/delay.h>

    7. #define LEDPORT PORTE


    8. int main( void )
    9. {
    10.    LEDPORT.DIR = 0xff;    // Set all pins of port D to output.
    11.        
    12.    while (1)
    13.    {
    14.         LEDPORT.OUT++;
    15.         // Delay
    16.         _delay_ms(100);
    17.    }
    18. }
    复制代码
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-5-20 17:12 , Processed in 0.097269 second(s), 15 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.