Upload Code
loading-left
loading loading loading
loading-right

Loading

Profile
No self-introduction
codes (6)
Anonymous four axis source code ANO_ FLY_ F4-v1.0
no vote
/* Includes ------------------------------------------------------------------*/#include "config.h"__ IO u8 MS5611_ Cal_ Flag = 0;__ IO u8 AK8975_ Cal_ Flag = 0;__ IO u16 DEBUG_ CNT;int main(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("NRF24L01 IS OK !\r\n");  else Uart1_ Put_ String("NRF24L01 IS NOT OK !\r\n");MPU6050_ Init();Uart1_ Put_ String("Welcome to ANO TC!\r\n");if(SD_ Card_ Init())Uart1_ Put_ String("SD_ Card OK!\r\n");elseUart1_ Put_ String("SD_ Card Error!\r\n");Data_ Read();while (1){
昱晨
2016-08-23
0
1
MPU6050 (hardware IIC)
4.0
 #include "stm32f10x.h"#include "I2C_ MPU6050.h"#include "usart1.h"#include "delay.h"int main(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) COPYRIGHT 2012 WildFire Team *****END OF FILE************/
昱晨
2016-08-23
2k+
4
The HMC5883 calibration
no vote
function a = fitellipse(XY) % FITELLIPSE Least-squares fit of ellipse to 2D points. % A = FITELLIPSE(XY) returns the parameters of the best-fit % ellipse to 2D points XY. % The returned vector A contains the center, radii, and orientation % of the ellipse, stored as (Cx, Cy, Rx, Ry) % % Example: Run fitellipse without any arguments to get a demo if nargin == 0 % Create an ellipse t = linspace(0,2); Rx = 300 Ry = 200 Cx = 250 Cy = 150 Rotation = .4 % Radians x = Rx * cos(t); y = Ry * sin(t); nx = x*cos(Rotation)-y*sin(Rotation) + Cx; ny = x*sin(Rotation)+y*cos(Rotation) + Cy; % Draw it plot(nx,ny,\'o\'); % Fit it fitellipse(nx,ny) % Note it returns (Rotation - pi/2) and swapped radii, this is fine. return end % normalize data X=XY(:,1); Y=XY(:,2); mx = mean(X);
昱晨
2016-08-23
0
1
MPU6050 DMP(InvenSense)
no vote
#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"#define q30 1073741824int result;int16_ t Pitch,Roll,Yaw;char Packet[24];void InitUART(void){  UCA0CTL1 |= UCSWRST;  UCA0CTL1 |= UCSSEL_ 2;  UCA0BR0 = 138;  UCA0BR1 = 0;  UCA0MCTL |= UCBRF_ 0 + UCBRS_ 7;//+ UCOS16;  P3SEL |= 0x30;  UCA0CTL1 &= ~UCSWRST;}void USART_ Send(char data){  while(!(IFG2&UCA0TXIFG));  UCA0TXBUF = data;}void UART1_ ReportIMU(int16_ t yaw,int16_ t pitch,int16_ t roll,int16
昱晨
2016-08-23
0
1
STM32_ 6050 routine
no vote
#include "led.h"#include "delay.h"#include "sys.h"#include "usart.h"#include "MPU6050.h"#include "I2C.h" int main(void) {unsigned char Read=0; short temp1[3];short temp2[3];short temp3;    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
no vote
/* * This file is part of baseflight * Licensed under GPL V3 or modified DCL - see https://github.com/multiwii/baseflight/blob/master/README.md */ #include "board.h" #include "mw.h" #include "telemetry_common.h" core_t core; int hw_revision = 0; extern rcReadRawDataPtr rcReadRawFunc; receiver read function extern uint16_t pwmReadRawRC(uint8_t chan); from system_stm32f10x.c void SetSysClock(bool overclock); #ifdef USE_LAME_PRINTF gcc/GNU version static void _putc(void *p, char c) { (void)p; serialWrite(core.mainport, c); } #else keil/armcc version int fputc(int c, FILE *f) { let DMA catch up a bit when using set or dump, we\'re too fast. while (!isSerialTransmitBufferEmpty(core.mainport)); serialWrite(core.mainport, c);
昱晨
2016-08-23
0
1
No more~