?? lsd1.c
字號(hào):
//*******************************************************************************
// MSP-FET430P140 Demo - Software Toggle P1.0
//
// Description: Toggle P1.0 by xor'ing P1.0 inside of a software loop.
// ACLK= n/a, MCLK= SMCLK= default DCO ~800k
//
// MSP430F149
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | P1.0|-->LED
//
// M. Buccini
// Texas Instruments Inc.
// Feb 2005
// Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
//******************************************************************************
#include <msp430x14x.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0xff; // Set P1.0 to output direction
volatile unsigned int i;
int a[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,
0x00,
0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,
0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,
0x00,
0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80};
while(1)
{ volatile unsigned int j;
for (j=0;j<=61;j++)
{
P1OUT=a[j] ;
for(i=0;i<10000;i++);
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -