演示:
b32c8e7f6fda8619ca17d4e76e30f2b.jpg
代码
exboard.h
#define uint unsigned int
#define uchar unsigned char
#define uint32 unsigned long
#define LED1 P1_0
#define LED2 P1_1
#define KEY1 P0_1
#define KEY2 P2_0
main.cpp
#include<ioCC2530.h>
#include "exboard.h"
void main(void)
{
P1SEL = ~0x03; // 0011 0000 设置P1_0,P1_1为通用IO
P1DIR = 0x03; // 0011 设置P1_0,P1_1为输出模式
while(1)
{
LED1 = 0;
LED2 = 0;
}
}
网友评论