
Lecteur NFC sur STM32F746G-DISCO
Dependencies: TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG
/media/uploads/MatthieuBichet/interfa-age_nfc.pdf
Revision 1:913f00f0b737, committed 2019-06-04
- Comitter:
- MatthieuBichet
- Date:
- Tue Jun 04 14:20:35 2019 +0000
- Parent:
- 0:88344fc82f63
- Commit message:
- Version 1 : Scan du tag NFC;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 04 13:57:22 2019 +0000 +++ b/main.cpp Tue Jun 04 14:20:35 2019 +0000 @@ -62,15 +62,11 @@ for(i=0;i<9;i++) //send command NFC_Send_Byte(firmware[i]); } -void callback() - { - - - } + int main() { - //NFC.attach(&callback); + TS_StateTypeDef TS_State; uint16_t x, y; uint8_t text[30]; @@ -102,9 +98,7 @@ lcd.FillRect(100, 100, 100, 75); lcd.DisplayStringAt(0, LINE(3), (uint8_t *) " SCAN", LEFT_MODE); while(1) - {//lcd.Clear(LCD_COLOR_WHITE); - - //lcd.Clear(LCD_COLOR_WHITE); + { ts.GetState(&TS_State); if (TS_State.touchDetected) @@ -117,7 +111,7 @@ lcd.FillRect(100, 100, 100, 75); send_tag(); wait(0.200); - read_ACK(19); + read_ACK(18); } else { @@ -129,28 +123,13 @@ lcd.SetTextColor(LCD_COLOR_RED); lcd.FillRect(100, 100, 100, 75); } - //; - //firmware_version(); - //read_ACK(11); - //pc.printf("\r\n"); - //wait(1); q=0; - //while(NFC.readable()) - //{ - // message[q] = NFC.getc(); - //q++; - //pc.printf("%c",message[q]); - //} sprintf(msg, "ID %d %02X%02X%02X%02X%02X%02X",q,(int)message[13],(int)message[14],(int)message[15],(int)message[16],(int)message[17],(int)message[18]); lcd.DisplayStringAt(0,LINE(9), (uint8_t *)msg, CENTER_MODE); - //lcd.SetTextColor(LCD_COLOR_RED); - //lcd.SetBackColor(LCD_COLOR_WHITE); - //lcd.FillRect(10,25,25,25); - //wait(1); } }