![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
programme capteur d'empreinte digital
main.cpp@26:0e5bf5f7a6d5, 2019-06-06 (annotated)
- Committer:
- alain77
- Date:
- Thu Jun 06 19:51:10 2019 +0000
- Revision:
- 26:0e5bf5f7a6d5
- Parent:
- 25:586781d009dd
programme interface pour capteur d'empreinte digitale ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 14:36859ef194d1 | 1 | //----------------------------------------------------------------------- |
MikamiUitOpen | 0:629ff18592b9 | 2 | // GuiBase とその派生クラスのデモプログラム |
MikamiUitOpen | 0:629ff18592b9 | 3 | // Demo program for GuiBase class and its derivertive classes |
MikamiUitOpen | 1:b4bcb6fa2a1d | 4 | // |
MikamiUitOpen | 8:8a55f2e374da | 5 | // GuiBase, Button, ButtonGroup, Label, NumericLabel, BlinkLabel, |
MikamiUitOpen | 25:586781d009dd | 6 | // SeekBar, SeekbarGroup, NumericUpDown |
MikamiUitOpen | 0:629ff18592b9 | 7 | // |
alain77 | 26:0e5bf5f7a6d5 | 8 | |
MikamiUitOpen | 25:586781d009dd | 9 | // |
MikamiUitOpen | 25:586781d009dd | 10 | // 2018/03/12, Copyright (c) 2018 MIKAMI, Naoki |
MikamiUitOpen | 14:36859ef194d1 | 11 | //----------------------------------------------------------------------- |
alain77 | 26:0e5bf5f7a6d5 | 12 | #include "mbed.h" |
alain77 | 26:0e5bf5f7a6d5 | 13 | #include "TS_DISCO_F746NG.h" |
alain77 | 26:0e5bf5f7a6d5 | 14 | #include "LCD_DISCO_F746NG.h" |
alain77 | 26:0e5bf5f7a6d5 | 15 | #include "F746_GUI.hpp" |
alain77 | 26:0e5bf5f7a6d5 | 16 | Serial pc(USBTX, USBRX); |
alain77 | 26:0e5bf5f7a6d5 | 17 | Serial test(PC_6,PC_7); |
alain77 | 26:0e5bf5f7a6d5 | 18 | LCD_DISCO_F746NG lcd; |
alain77 | 26:0e5bf5f7a6d5 | 19 | TS_DISCO_F746NG ts; |
MikamiUitOpen | 0:629ff18592b9 | 20 | |
MikamiUitOpen | 0:629ff18592b9 | 21 | |
MikamiUitOpen | 0:629ff18592b9 | 22 | int main() |
alain77 | 26:0e5bf5f7a6d5 | 23 | { |
alain77 | 26:0e5bf5f7a6d5 | 24 | char i; |
alain77 | 26:0e5bf5f7a6d5 | 25 | /* initialisation bouton autorisé , refusé ,reset */ |
alain77 | 26:0e5bf5f7a6d5 | 26 | Label obj10(180, 2, "DEMANDE D'ACCES "); |
alain77 | 26:0e5bf5f7a6d5 | 27 | Button button1(20, 80, 75, 40, "Autorise"); |
alain77 | 26:0e5bf5f7a6d5 | 28 | Button button2(120,80, 75, 40, "Refuse"); |
alain77 | 26:0e5bf5f7a6d5 | 29 | Button button3(200,80, 75, 40, "Reset"); |
MikamiUitOpen | 0:629ff18592b9 | 30 | |
alain77 | 26:0e5bf5f7a6d5 | 31 | |
alain77 | 26:0e5bf5f7a6d5 | 32 | //pc.printf("Ok "); |
MikamiUitOpen | 0:629ff18592b9 | 33 | |
alain77 | 26:0e5bf5f7a6d5 | 34 | while(1) |
alain77 | 26:0e5bf5f7a6d5 | 35 | { |
alain77 | 26:0e5bf5f7a6d5 | 36 | /* envoie init capteur */ |
alain77 | 26:0e5bf5f7a6d5 | 37 | test.putc(0x55); |
alain77 | 26:0e5bf5f7a6d5 | 38 | test.putc(0xAA); |
alain77 | 26:0e5bf5f7a6d5 | 39 | test.putc(0x01); |
alain77 | 26:0e5bf5f7a6d5 | 40 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 41 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 42 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 43 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 44 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 45 | test.putc(0x01); |
alain77 | 26:0e5bf5f7a6d5 | 46 | test.putc(0x01); |
MikamiUitOpen | 21:61059fe1ec47 | 47 | |
alain77 | 26:0e5bf5f7a6d5 | 48 | /* caputre empreinte */ |
alain77 | 26:0e5bf5f7a6d5 | 49 | |
alain77 | 26:0e5bf5f7a6d5 | 50 | test.putc(0x55); |
alain77 | 26:0e5bf5f7a6d5 | 51 | test.putc(0xAA); |
alain77 | 26:0e5bf5f7a6d5 | 52 | test.putc(0x01); |
alain77 | 26:0e5bf5f7a6d5 | 53 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 54 | test.putc(0x23); |
alain77 | 26:0e5bf5f7a6d5 | 55 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 56 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 57 | test.putc(0x00); |
alain77 | 26:0e5bf5f7a6d5 | 58 | test.putc(0x01); |
alain77 | 26:0e5bf5f7a6d5 | 59 | test.putc(0x01); |
alain77 | 26:0e5bf5f7a6d5 | 60 | |
alain77 | 26:0e5bf5f7a6d5 | 61 | |
alain77 | 26:0e5bf5f7a6d5 | 62 | |
alain77 | 26:0e5bf5f7a6d5 | 63 | /* partie interface graphique */ |
alain77 | 26:0e5bf5f7a6d5 | 64 | lcd.DisplayStringAt(-180, 150, (uint8_t *)"IDENTITE", CENTER_MODE); |
alain77 | 26:0e5bf5f7a6d5 | 65 | lcd.DisplayStringAt(-180, 170, (uint8_t *)"NOM de la personne : ", CENTER_MODE); |
alain77 | 26:0e5bf5f7a6d5 | 66 | |
alain77 | 26:0e5bf5f7a6d5 | 67 | /* condion d'accès manuel */ |
alain77 | 26:0e5bf5f7a6d5 | 68 | |
alain77 | 26:0e5bf5f7a6d5 | 69 | if (button1.Touched()){ |
alain77 | 26:0e5bf5f7a6d5 | 70 | button2.Inactivate(); |
alain77 | 26:0e5bf5f7a6d5 | 71 | lcd.DisplayStringAt(0, 45, (uint8_t *)"Acces autorise", CENTER_MODE); |
MikamiUitOpen | 0:629ff18592b9 | 72 | } |
MikamiUitOpen | 0:629ff18592b9 | 73 | |
alain77 | 26:0e5bf5f7a6d5 | 74 | if ( button2.Touched()){ |
alain77 | 26:0e5bf5f7a6d5 | 75 | lcd.DisplayStringAt(0, 45, (uint8_t *)" " , CENTER_MODE); |
alain77 | 26:0e5bf5f7a6d5 | 76 | button1.Inactivate(); |
alain77 | 26:0e5bf5f7a6d5 | 77 | lcd.DisplayStringAt(0, 45, (uint8_t *)"Acces refuser", CENTER_MODE); |
alain77 | 26:0e5bf5f7a6d5 | 78 | } |
alain77 | 26:0e5bf5f7a6d5 | 79 | if ( button3.Touched()){ |
alain77 | 26:0e5bf5f7a6d5 | 80 | lcd.DisplayStringAt(0, 45, (uint8_t *)" " , CENTER_MODE); |
alain77 | 26:0e5bf5f7a6d5 | 81 | button1.Activate(); |
alain77 | 26:0e5bf5f7a6d5 | 82 | button2.Activate(); |
MikamiUitOpen | 12:262492b42b04 | 83 | } |
alain77 | 26:0e5bf5f7a6d5 | 84 | } |
MikamiUitOpen | 0:629ff18592b9 | 85 | |
alain77 | 26:0e5bf5f7a6d5 | 86 | } |