Skip to content

Flex Glove implementado #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Sensores/IMU-MCU6050-I2C/IMU-MCU6050-I2C/src/main.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Computa��o Embarcada
* Computação Embarcada
* Insper
* Rafael Corsi - [email protected]
* C�digo exemplo uso I2C
* Código exemplo uso I2C
* Abril - 2017
*
* Bug conhecido : spi read deve ser executado duas vezes ?
Expand All @@ -23,7 +23,7 @@

#include "asf.h"
#include "mpu6050.h"
#include "Fusion/Fusion.h"
#include "fusion/fusion.h"

/************************************************************************/
/* VAR globais */
Expand Down Expand Up @@ -197,7 +197,7 @@ int main(void){
/* Inicializa funcao de delay */
delay_init( sysclk_get_cpu_hz());

/* Inicializa Fun��o de fus�o */
/* Inicializa Função de fusão */
FusionAhrs ahrs;
FusionAhrsInitialise(&ahrs);

Expand All @@ -215,7 +215,7 @@ int main(void){
printf("[ERRO] [i2c] [read] \n");
}

// Por algum motivo a primeira leitura errada.
// Por algum motivo a primeira leitura é errada.
if(bufferRX[0] != 0x68){
printf("[ERRO] [mcu] [Wrong device] [0x%2X] \n", bufferRX[0]);
}
Expand Down Expand Up @@ -246,16 +246,16 @@ int main(void){
rtn = mcu6050_i2c_bus_read(MPU6050_DEFAULT_ADDRESS, MPU6050_RA_ACCEL_ZOUT_H, &raw_acc_zHigh, 1);
rtn = mcu6050_i2c_bus_read(MPU6050_DEFAULT_ADDRESS, MPU6050_RA_ACCEL_ZOUT_L, &raw_acc_zLow, 1);

// Dados s�o do tipo complemento de dois
// Dados são do tipo complemento de dois
raw_acc_x = (raw_acc_xHigh << 8) | (raw_acc_xLow << 0);
raw_acc_y = (raw_acc_yHigh << 8) | (raw_acc_yLow << 0);
raw_acc_z = (raw_acc_zHigh << 8) | (raw_acc_zLow << 0);
proc_acc_x = (float)raw_acc_x/16384;
proc_acc_y = (float)raw_acc_y/16384;
proc_acc_z = (float)raw_acc_z/16384;

// Configura range gyroscopio para operar com 250 /s
bufferTX[0] = 0x00; // 250 /s
// Configura range gyroscopio para operar com 250 °/s
bufferTX[0] = 0x00; // 250 °/s
rtn = mcu6050_i2c_bus_write(MPU6050_DEFAULT_ADDRESS, MPU6050_RA_GYRO_CONFIG, bufferTX, 1);

// Le valor do gyr X High e Low
Expand All @@ -270,7 +270,7 @@ int main(void){
rtn = mcu6050_i2c_bus_read(MPU6050_DEFAULT_ADDRESS, MPU6050_RA_GYRO_ZOUT_H, &raw_gyr_zHigh, 1);
rtn = mcu6050_i2c_bus_read(MPU6050_DEFAULT_ADDRESS, MPU6050_RA_GYRO_ZOUT_L, &raw_gyr_zLow, 1);

// Dados s�o do tipo complemento de dois
// Dados são do tipo complemento de dois
raw_gyr_x = (raw_gyr_xHigh << 8) | (raw_gyr_xLow << 0);
raw_gyr_y = (raw_gyr_yHigh << 8) | (raw_gyr_yLow << 0);
raw_gyr_z = (raw_gyr_zHigh << 8) | (raw_gyr_zLow << 0);
Expand All @@ -283,7 +283,7 @@ int main(void){
// replace this with actual accelerometer data in g
const FusionVector accelerometer = {proc_acc_x, proc_acc_y, proc_acc_z};

// calcula runtime do c�digo acima para definir delta t do programa
// calcula runtime do código acima para definir delta t do programa
int tick = rtt_read_timer_value(RTT);
float delta_time = (tick - tick_old)/1000.0;
tick_old = tick;
Expand Down
22 changes: 22 additions & 0 deletions Sensores/QWIIC-FLEX-GLOVE-I2C/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Ignore Atmel Studio temporary files and build results
# https://www.microchip.com/mplab/avr-support/atmel-studio-7

# Atmel Studio is powered by an older version of Visual Studio,
# so most of the project and solution files are the same as VS files,
# only prefixed by an `at`.

#Build Directories
[Dd]ebug/
[Rr]elease/

#Build Results
*.o
*.d
*.eep
*.elf
*.hex
*.map
*.srec

#User Specific Files
*.atsuo
22 changes: 22 additions & 0 deletions Sensores/QWIIC-FLEX-GLOVE-I2C/bme280-i2c.atsln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Atmel Studio Solution File, Format Version 11.00
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "bme280-i2c", "bme280-i2c.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Release|ARM = Release|ARM
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
{DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
4 changes: 4 additions & 0 deletions Sensores/QWIIC-FLEX-GLOVE-I2C/bme280-i2c.componentinfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Store xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="AtmelPackComponentManagement">
<ProjectComponents />
</Store>
Loading