Digiti II
/
MPU_RFID_MAX_LAB
ptoo elq ue lo lea
Diff: main.cpp
- Revision:
- 5:8d56c59a45a8
- Parent:
- 4:fcfb02e6a11f
--- a/main.cpp Tue Nov 03 22:38:39 2020 +0000 +++ b/main.cpp Sun Feb 28 02:33:47 2021 +0000 @@ -52,6 +52,7 @@ DigitalIn boton(PC_13); // 0 - presionado int aux = 0 ; int aux2 = 0; +int mistake = 0; int signal = 0; unsigned char personal[8]= {0x0,0x0,0,0,0,0,0,0}; unsigned char filas[8]= {1,3,7,0x0f,0x1f,0x3f,0x7f,0xff}; @@ -60,12 +61,20 @@ I2C i2c(D14, D15); MFRC522 RfChip (SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS, MF_RESET); void giroscope(); +void muestreo(); void rfid(); void InitMPU(); //int ReadData(int adress_L, int adress_H); char reg_value[2]; void WriteData(uint8_t address, uint8_t subAddress, uint8_t data); int ReadData(int adress_L, int adress_H); + +void muestreo() { + + + } + + void giroscope(){ while(1) { pc.printf(" "); @@ -123,8 +132,8 @@ if ( ! RfChip.PICC_IsNewCardPresent()){ wait_ms(200); //pc.printf("1 "); - pc.printf("%i\t\n\r",ReadData(RA_GYRO_YOUT_L ,RA_GYRO_YOUT_H)); - + pc.printf("%i\t\n\r",ReadData(RA_GYRO_YOUT_L ,RA_GYRO_YOUT_H)); + // mistake = ReadData(RA_GYRO_YOUT_L ,RA_GYRO_YOUT_H); continue; } // Select one of the cards @@ -134,11 +143,9 @@ continue; } led=1; - // Print Card UID - // pc.printf("Card UID: "); + for (uint8_t i = 0; i < RfChip.uid.size; i++){ - /* pc.printf(" %X02", RfChip.uid.uidByte[i]); - pc.printf("-A1-\n\r");*/ + if (aux == 0) { aux = RfChip.uid.uidByte[i]; //registra la primera tarjeta que entre led3 = 1; @@ -154,8 +161,8 @@ signal = 1; pc.printf("15000\n\r"); /*------*/ - wait_us(5e6); - matrix(); + wait_us(2e6); + //matrix(); ledG = 0; signal = 0; pc.printf("-15000\n\r");