发布
loading-left
loading loading loading
loading-right

加载中

个人主页
TA还没有准备介绍自己
TA的源代码 (6)
匿名四轴源码ANO_FLY_F4-v1.0
暂无评分
/*Includes------------------------------------------------------------------*/#include"config.h"__IOu8MS5611_Cal_Flag=0;__IOu8AK8975_Cal_Flag=0;__IOu16DEBUG_CNT;intmain(void){Usart1_Init(500000);Usart2_Init(19200);Tim_Pwm_In_Init(); //ÊäÈ벶»ñTim_Pwm_Out_Init();Timer_Sys_Init(500);I2C1_RESET();I2C1_INIT(0X00,400000,1,1,1,1);Led_Init();Spi1_Init();Nvic_Init();Nrf24l01_Init(MODEL_TX2,40);  if(Nrf24l01_Check()) Uart1_Put_String("NRF24L01ISOK!\r\n");  else Uart1_Put_String("NRF24L01ISNOTOK!\r\n");MPU6050_Init();Uart1_Put_String("WelcometoANOTC!\r\n");if(SD_Card_Init())Uart1_Put_String("SD_CardOK!\r\n");elseUart1_Put_String("SD_CardError!\r\n");Data_Read();while(1){
昱晨
2016-08-23
0
1
对传感器MPU6050进行调试设置参数(硬件IIC)
4.0分
 #include"stm32f10x.h"#include"I2C_MPU6050.h"#include"usart1.h"#include"delay.h"intmain(void){ InitMPU6050();/***********************************************************************/while(1){printf("\r\n---------------%d\r\n",GetData(ACCEL_XOUT_H));printf("\r\n----------------%d\r\n",GetData(ACCEL_YOUT_H));printf("\r\n------------------%d\r\n",GetData(ACCEL_ZOUT_H));printf("\r\n---------------%d\r\n",GetData(GYRO_XOUT_H));printf("\r\n-----------------%d\r\n",GetData(GYRO_YOUT_H));printf("\r\n---------Í---------%d\r\n",GetData(GYRO_ZOUT_H));delay_ms(500);} }/*******************(C)COPYRIGHT2012WildFireTeam*****ENDOFFILE************/
昱晨
2016-08-23
0
1
用matlab对传感器HMC5883进行校准
暂无评分
功能=椭圆拟合(XY)%的椭圆拟合最小二乘法拟合椭圆二维点。%=椭圆拟合(XY)返回的最佳拟合参数%的椭圆二维点XY。%返回的向量包含中心,半径,和取向%的椭圆,存储为(CX,CY,RX,RY)%%的例子:没有任何参数运行的椭圆拟合得到一个演示如果nargin==0为创建一个椭圆T=linspace(0,2);Rx=300RY=200CX=250CY=150=4%弧度的旋转。x=RX*COS(T);Y=ry*罪(T);NX=××COS(旋转)-Y*罪(旋转)+Cx;纽约=x*罪(旋转)+Y*COS(旋转)+环磷酰胺;%的画情节(NX,纽约,O);为适应它椭圆拟合(NX,纽约)%注意它返回(旋转-π/2)和交换的半径,这是好的返回结束为规范化数据x=XY(:,1);Y=XY(:,2);MX=均值(x);我的意思是(Y);SX=(max(x)-min(x))/2;SY=(max(Y)-min(Y))/2;x=(x-mx)/SX;Y=(y-my)/系统;%的力向量X=X(:);Y=Y(:);%建立设计矩阵a[XXXYY***yxy的(大小(x))];%建立散射矩阵S=D*D;%建立6x6的约束矩阵C(6,6)=0;C(1,3)=2;C(2,2)=1;C(3,1)=2;为解决特征[gevec,geval]=EIG(S,C);为找到负本征值我发现(房(诊断(geval))<1e-8和~isinf(诊断(ge
昱晨
2016-08-23
0
1
MPU6050 DMP(InvenSense)
暂无评分
#include#include#include#include#include#include"msp430.h"#include"msp430_clock.h"#include"msp430_i2c.h"//#include"msp430_interrupt.h"#include"inv_mpu.h"#include"inv_mpu_dmp_motion_driver.h"#defineq301073741824intresult;int16_tPitch,Roll,Yaw;charPacket[24];voidInitUART(void){ UCA0CTL1|=UCSWRST; UCA0CTL1|=UCSSEL_2; UCA0BR0=138; UCA0BR1=0; UCA0MCTL|=UCBRF_0+UCBRS_7;//+UCOS16; P3SEL|=0x30; UCA0CTL1&=~UCSWRST;}voidUSART_Send(chardata){ while(!(IFG2&UCA0TXIFG)); UCA0TXBUF=data;}voidUART1_ReportIMU(int16_tyaw,int16_tpitch,int16_troll,int16
昱晨
2016-08-23
0
1
STM32_6050例程
暂无评分
#include"led.h"#include"delay.h"#include"sys.h"#include"usart.h"#include"MPU6050.h"#include"I2C.h" intmain(void) {unsignedcharRead=0; shorttemp1[3];shorttemp2[3];shorttemp3;   SystemInit();//ϵͳʱÖӵȳõʼ»¯delay_init(72);   //ÑÓʱ³õʼ»¯NVIC_Configuration();//ÉèÖÃNVICÖжϷÖ×é2:2λÇÀÕ¼ÓÅÏȼ¶£¬2λÏìÓ¦ÓÅÏȼ¶uart_init(9600);//´®¿Ú³õʼ»¯Îª9600  LED_Init(); //LED¶Ë¿Ú³õʼ»¯ I2C_Simulation_Init();delay_ms(100);MPU6050_Init();delay_ms(100);MPU6050_ReadData(0x75,&Read,1);printf("2402read=%d\r\n",Read);   while(1){MPU6050ReadAcc(temp1); printf("¼ÓËٶȣº%8.3f%8.3f%8.3f",(float)((temp1[0]/16384.0f)*9.81f),(float)((temp1[1]/16384.0f)*9.81f),(float)((temp1[2]/16
昱晨
2016-08-23
0
1
baseflight-master
暂无评分
/* *Thisfileispartofbaseflight *LicensedunderGPLV3ormodifiedDCL-seehttps://github.com/multiwii/baseflight/blob/master/README.md */#include"board.h"#include"mw.h"#include"telemetry_common.h"core_tcore;inthw_revision=0;externrcReadRawDataPtrrcReadRawFunc;//receiverreadfunctionexternuint16_tpwmReadRawRC(uint8_tchan);//fromsystem_stm32f10x.cvoidSetSysClock(booloverclock);#ifdefUSE_LAME_PRINTF//gcc/GNUversionstaticvoid_putc(void*p,charc){  (void)p;  serialWrite(core.mainport,c);}#else//keil/armccversionintfputc(intc,FILE*f){  //letDMAcatchupabitwhenusingsetordump,we'retoofast.  while
昱晨
2016-08-23
0
1
没有更多了~