Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LibPN532 BSP_DISCO_F746NG
main.cpp
- Committer:
- maximemau
- Date:
- 2020-07-01
- Revision:
- 1:d6f2fe7658fc
- Parent:
- 0:19b9f387ca62
File content as of revision 1:d6f2fe7658fc:
#include "mbed.h"
#include "PN532_HSU.h"
#include "HardwareSerial.h"
#include "LCD_DISCO_F746NG.h"
void init(void);
void affichage(void);
void affichageok(void);
void affichagefalse(void);
//
HardwareSerial nfc(A4,A5);
int main(void)
{
int numbadge;
int numbagevalid;
init();
PN532_HSU::begin();
PN532_HSU::wakeup();
while(1)
{
affichage();
numbadge = PN532_HSU::writeCommand();
numbadge = PN532_HSU::readResponse();
if(numbadge==numbadgevalid)
{
effichageok();
}
else if (numbadge!=numbadgevalid && numbadge!=0)
{
affichagefalse();
}
else
{
affichage;
}
}
}
void init(void)
{
int res;
res = init();
Clear(0x0000FF);
}
void affichage(void)
{
char text ="badgez svp";
SetBackColor(0x0000FF);
setTextColor(0xFFFFFF);
DisplayStringAt(50, 50,text,CENTER_MODE);
}
void affichageok(void)
{
char text ="vous etes autoriser a passer";
clear(0x00FF00);
DisplayStringAt(50, 50,text,CENTER_MODE);
}
void affichagefalse(void)
{
char text ="vous n'etes pas autoriser a passer";
clear(0xFF0000);
DisplayStringAt(50, 50,text,CENTER_MODE);
}