ex3c.c

来自「nRF24E1 sample transmit & receiver」· C语言 代码 · 共 34 行

C
34
字号
/*= ex3c.c =====================================================================
 *
 * Copyright (C) 2003, 2004 Nordic Semiconductor
 *
 * This file is distributed in the hope that it will be useful, but WITHOUT
 * WARRANTY OF ANY KIND.
 * 
 * Author(s): Ole Saether
 *
 * DESCRIPTION:
 *
 *  PWM example program.
 *
 *  The functionality is the same as in ex3a.asm.
 *
 * COMPILER:
 *
 *  This program has been tested with Keil C51 V7.07a.
 *
 * $Revision: 4 $
 *
 *==============================================================================
*/
#include <Nordic\reg24e1.h>

void main(void)
{
    P0_ALT = 0x80;      // Enable PWM output
    PWMCON = 0xc0;      // Enable 8 bit PWM with min prescaler
    PWMDUTY = 10;       // High 10 out of 255 periods
    for(;;)
        ;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?