
CC2530
FranzLiszt1847
大道如青天,我独不得出
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CC2530——点对点通信实现跑马灯
点对点通信实现跑马灯内容简介代码解析全部代码内容简介ZIGBBE自组网方式,将两个ZIGBBE盒进行组网按键按下A将数据发送给BB判断是否有ZIGBBE信号,如果有就接收信息如果接收到的数据为开启跑马灯,则开启跑马灯代码解析按键按下LED3亮并且A发送数据给B if(scan_key()) //有按键,则发送数据 { halLedToggle(3); // 绿灯取反,发送指示 LED3 ba原创 2021-04-25 11:50:33 · 2956 阅读 · 1 评论 -
CC2530——点对点通信
点对点通信内容简介代码分析全部代码全部头文件内容简介申明:下面用到的方法为basicrf封装好的,在网上下载好之后,之间include导入即可通过ZIGBBE自组网,将俩个ZIGBBE盒进行连接,下面简称A和B通信:A将采集到的数据通过无线发送给B,B接收后在发送给PC端模拟串口软件代码分析采集光照数据,将采集到的模拟量转成数字量,然后在解析数据量,转成可视化光照数据void hal_adc_Init1(void){ APCFG |=1; P0SEL |= (1 <&原创 2021-04-25 11:39:15 · 5882 阅读 · 5 评论 -
CC2530————A-D转换应用之实现外部电压测量
#include<iocc2530.h>#define uint16 unsigned short#define uint32 unsigned long#define uint unsigned int#define uchar unsigned char#define LED1 P1_0///功能:获取电压值,并转换通过一定方式转换并赋值给数组再发送给PC端///uchar count;uchar s[8];/P1初始化/void P1_int(void){A原创 2021-01-28 15:53:30 · 1883 阅读 · 1 评论 -
CC2530————T1定时器(自由计数模式)实现PWM(呼吸灯)
#include<iocc2530.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0uchar h = 1;void InitLED(void){P1SEL &=~0X01;P1DIR |=0X01;LED1 =0;}void InitT1(void){T1CTL |= 0X01;//一分频,自由计数模式,2-3为分频,0-1为计数模式PERCFG = 0X40;P原创 2021-01-27 11:29:29 · 3472 阅读 · 2 评论 -
CC2530————按键实现PWM(呼吸灯)
#include <ioCC2530.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0#define key P1_2void Delay(uint time){while(time–);}void InitLED(void){P1SEL&=~0x39;P1DIR |= 0x39;P1&=~0x39;}void InitKey(){P1SEL &原创 2021-01-27 11:28:21 · 3454 阅读 · 1 评论 -
CC2530————简单实现PWM(呼吸灯)
#include<iocc2530.h>#define uchar unsigned char#define uint unsigned int#define LED1 P1_0void Initial(void){P1DIR|=0X01;P1&=~0X01;}void Delay(uint time){while(time–);}void ON_OFF_LED(uint CYCLE , uint PWM_LOW){LED1=1;Delay(CYCLE);原创 2021-01-27 11:27:30 · 6072 阅读 · 7 评论 -
CC2530————串口助手数据发送与接收(中断法)
#include<iocc2530.h>#include<string.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0#define LED2 P1_5/***********************函数名称:Init_Led*函数功能:初始化led引脚*入口函数:*出口函数:/void Init_Led(void){P1SEL&=~0X39;P1DI原创 2021-01-27 11:24:10 · 3695 阅读 · 2 评论 -
CC2530————串口助手数据发送与接收(查询法)
#include<iocc2530.h>#include<string.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0#define LED2 P1_5/***********************函数名称:Init_Led*函数功能:初始化led引脚*入口函数:*出口函数:/void Init_Led(void){P1SEL&=~0X39;P1DI原创 2021-01-27 11:23:26 · 2821 阅读 · 2 评论 -
CC2530————接收PC端的信息控制LED灯(中断法)
#include<iocc2530.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_4#define LED4 P1_3#define uchar unsigned char#define uint unsigned intuchar c;/*********************************函数名称:Initial_Light*函数功能:初始化LED端口*入口函数:无*出口函数:无*返回值: 无/原创 2021-01-27 11:22:06 · 720 阅读 · 3 评论 -
CC2530————接收PC端的信息控制LED灯(查询法)
#include<iocc2530.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_4#define LED4 P1_3#define uchar unsigned char#define uint unsigned int/初始化P1口*/void Initial_Light(void){P1SEL &= ~0x39;P1DIR|=0X39;P1&=~0X39;}/初始化串口/void UAR原创 2021-01-27 11:20:44 · 919 阅读 · 1 评论 -
CC2530————向PC端发送数据(中断方式)
#include<iocc2530.h>#include<string.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_4#define LED4 P1_3#define uchar unsigned char#define uint unsigned intchar Data[]=“Hellosp”;uint count=0;void Delay(uint time){uint i;uchar j;原创 2021-01-27 11:18:48 · 1532 阅读 · 1 评论 -
CC2530————与串口助手交互实现控制LED灯
#include<iocc2530.h>#include<string.h>#define uchar unsigned char#define uint unsigned int#define LED1 P1_0#define LED2 P1_5#define LED3 P1_4#define LED4 P1_3uchar c;uchar temp;uchar Data[30]={0};uint count=0;void Init_LED(){P1SEL原创 2021-01-27 11:15:53 · 1778 阅读 · 2 评论 -
CC2530————T3定时器中断控制实现控制LED灯
#include<iocc2530.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_3#define LED4 P1_4#define uchar unsigned char#define uint unsigned intuchar count=0;void Initial(void){P1SEL&=~0X39;P1DIR|=0X39;P1&=~0X39;}void InitT3(void){原创 2021-01-27 11:16:08 · 2288 阅读 · 0 评论 -
CC2530————T3定时器查询法实现控制LED灯
/T3定时器为8位定时器*/#include<iocc2530.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_3#define LED4 P1_4#define uchar unsigned char#define uint unsigned intuchar count=0;void Initial(void){P1SEL&=~0X39;P1DIR|=0X39;P1&=~0X39;}void原创 2021-01-26 19:04:22 · 1238 阅读 · 1 评论 -
CC2530————T1定时器正计数/倒计数模式采用中断方式控制LED灯
/**************************************//* CC2530例程 *//*例程名称:定时器(中断方式) *//*描述:通过定时器T1中断方式控制LED1周期性闪烁**************************************/#include <ioCC2530.h>#define uint unsigned int#define uchar unsigned char#de原创 2021-01-26 18:57:40 · 5772 阅读 · 2 评论 -
CC2530————通过定时器T1查询方式控制LED1周期性闪烁(正计数/倒计数)
/**************************//* CC2530例程 //例程名称:定时器(查询方式) //建立时间:2016/05/1 //描述:通过定时器T1查询方式控制LED1周期性闪烁/#include <ioCC2530.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0 //原创 2021-01-26 18:56:03 · 2181 阅读 · 1 评论 -
CC2530————通过定时器T1查询方式控制LED1周期性闪烁(模模式)
/************************//* CC2530例程 //例程名称:定时器(查询方式) //描述:通过定时器T1查询方式控制LED1周期性闪烁/#include <ioCC2530.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0 //定义LED1为P1_0口控制//函数声明void InitLed(v原创 2021-01-26 18:54:16 · 3431 阅读 · 1 评论 -
CC2530————通过定时器T1查询方式控制LED1周期性闪烁(自由计数模式)
/************************//* CC2530例程 //例程名称:定时器(查询方式) //描述:通过定时器T1查询方式控制LED1周期性闪烁/#include <ioCC2530.h>#define uint unsigned int#define uchar unsigned char#define LED1 P1_0 //定义LED1为P1_0口控制//函数声明void InitLed(v原创 2021-01-26 18:53:06 · 3448 阅读 · 3 评论 -
CC2530————中断方式实现跑马灯
#include “ioCC2530.h”#define LED1 P1_0#define LED2 P1_5#define LED3 P1_3#define LED4 P1_4#define uint unsigned int#define uchar unsigned charuint flag_Pause=0;void delay(uint);void delay(uint time){ uint i;uchar j;for(i = 0; i < time; i++){原创 2021-01-26 18:49:55 · 3025 阅读 · 2 评论 -
CC2530————中断方式控制LED灯
#include “ioCC2530.h” // 引用头文件,包含对CC2530的寄存器、中断向量等的定义/********************************************************************/#define LED1 P1_0 // P1_0定义为P1.0#define SW1 P1_2 // P1_2定义为SW1/********************************************************原创 2021-01-26 18:48:21 · 2660 阅读 · 1 评论 -
CC2530————非中断方式实现按键控制LED灯
#include<iocc2530.h>#define uchar unsigned char#define uint unsigned intvoid Initial(void){P1SEL&=~0X39;P1DIR|=0X39;P1SEL&=~0X04;P1DIR&=~0X04;P1INP&=~0X04;P1&=~0X39;}void Delay(uint time){uint i;uchar j;for(i=0;i&l原创 2021-01-26 18:40:55 · 508 阅读 · 1 评论 -
CC2530-———非中断方式实现按键中断2
#include<iocc2530.h>#define uchar unsigned char#define uint unsigned int#define LED1 P1_5#define LED2 P1_0#define LED3 P1_3#define LED4 P1_4uint count=0;void Initial(void){P1SEL&=~0x39;P1DIR|=0x39;P1SEL&=~0x04;P1DIR&=~0x04;P原创 2021-01-26 18:39:10 · 372 阅读 · 1 评论 -
CC2530————非中断方式实现按键控制LED灯
//非中断方式实现按键控制LED灯/*1:全部灯熄灭2:按下按键SW1不超过一秒后松开LED灯亮3:再次按下灯灭*/#include<iocc2530.h>#define uint unsigned int#define uchar unsigned char#define LED P1_0void Initial(void){P1SEL&=~0x39;P1DIR|=0x39;P1SEL&=~0x04;//P1_2为通用IO口P1DIR&=~原创 2021-01-26 18:37:09 · 3332 阅读 · 2 评论 -
CC2530入门篇————花样灯
#include<iocc2530.h>#define uchar unsigned char#define uint unsigned int/LED1:P1_5LED2:P1_0LED3:P1_3LED4:P1_4/void Initial(void){P1SEL&=~0x39;//功能寄存器 :0为普通IO口,1为第二功能–外设P1DIR|=0x39;//方向寄存器 :0为输入 , 1为输出P1&=~0x39;//将四个灯熄灭}/*函数名称:Del原创 2021-01-25 19:56:29 · 547 阅读 · 1 评论 -
CC2530入门篇————通过延迟函数实现轮流闪烁
#include<iocc2530.h>#define LED1 P1_5#define LED2 P1_0#define LED3 P1_3#define LED4 P1_4#define uchar unsigned char#define uint unsigned cintvoid Initial_LED(void){P1SEL &= ~0x39;//功能寄存器 :0为普通IO口,1为第二功能–外设P1DIR |= 0x39;//方向寄存器 :0为输入 ,原创 2021-01-25 19:46:20 · 3927 阅读 · 2 评论 -
CC2530入门篇————实现四盏灯全亮
#include<iocc2530.h>//四个引脚分别对应板子上四个小灯#define LED1 P1_0#define LED2 P1_5#define LED3 P1_3#define LED4 P1_4void Init_LED(void){P1SEL&=~0x39;//功能寄存器 :0为普通IO口,1为第二功能–外设P1DIR|=0x39;//方向寄存器 :0为输入 , 1为输出P1&=~0x39;;//将四个灯熄灭}main(){Init_原创 2021-01-25 19:33:51 · 4471 阅读 · 1 评论 -
CC2530入门篇----点亮第一盏灯
#include<iocc2530.h>//引用的值与自己板子上对应的引脚有关//0x39对应我板子上的P1_0,P1_3,P1_4,P1_5四个引脚//通过进制运算最终得到0x39void Init_LED(void){P1SEL&=~0x39;//功能寄存器 :0为普通IO口,1为第二功能–外设P1DIR|=0x39;//方向寄存器 :0为输入 , 1为输出P1&=~0x39;//将四个灯熄灭,本例只采用一个灯}main(){Init_LED();w原创 2021-01-25 19:27:34 · 974 阅读 · 1 评论