{"id":13802432,"url":"https://github.com/chrisb2/micropython-fingerprint","last_synced_at":"2025-03-23T01:32:26.220Z","repository":{"id":82040840,"uuid":"252386638","full_name":"chrisb2/micropython-fingerprint","owner":"chrisb2","description":"MicroPython library for reading Grow and ZhianTec finger print sensors.","archived":false,"fork":false,"pushed_at":"2020-05-01T07:05:43.000Z","size":82,"stargazers_count":15,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-22T12:35:54.809Z","etag":null,"topics":["esp32","fingerprint-sensor","micropython","pyboard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisb2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-02T07:34:56.000Z","updated_at":"2024-01-27T09:46:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b4fd18a-19dc-4559-bd0a-a4588ce00755","html_url":"https://github.com/chrisb2/micropython-fingerprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fmicropython-fingerprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fmicropython-fingerprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fmicropython-fingerprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fmicropython-fingerprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisb2","download_url":"https://codeload.github.com/chrisb2/micropython-fingerprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221842109,"owners_count":16890109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32","fingerprint-sensor","micropython","pyboard"],"created_at":"2024-08-04T00:01:44.386Z","updated_at":"2024-10-28T14:44:05.453Z","avatar_url":"https://github.com/chrisb2.png","language":"Python","readme":"# micropython-fingerprint\n[MicroPython](https://micropython.org/) library for reading ZhianTec finger print sensors.\n\nThis MicroPython library is a slightly modified version of the [pyfingerprint](https://github.com/bastianraschke/pyfingerprint)\nfor the Raspberry Pi and has the same [German free software license](http://www.d-fsl.org).\n\nAs with the original library it should work with ZFM-20, ZFM-60, etc sensors. I have been testing with the R503 sensor.\n\nA small test program to verify that the sensor is communicating. Depending on\nwhat development board is in use, the UART instance may have to be differently\nconfigured. Note that the baud rate MUST be a multiple of 9600.\n```\nfrom pyfingerprint import PyFingerprint\nfrom machine import UART\n\nsensorSerial = UART(1)\n# ESP32 (pins 12, 13)\nsensorSerial.init(57600, bits=8, parity=None, stop=1, rx=13, tx=12)\n# pyboard v1.1 (pins X9, X10)\n# sensorSerial.init(57600, bits=8, parity=None, stop=1)\n\nf = PyFingerprint(sensorSerial)\nf.verifyPassword() # should return True\n```\n\nFurther example programs which should be easily adapted can be found with the original [pyfingerprint](https://github.com/bastianraschke/pyfingerprint/tree/Development/src/files/examples) library.\n\n# Trouble Shooting\n\n## Download characteristics packet corruption\n```\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"pyfingerprint.py\", line 1461, in downloadCharacteristics\n  File \"pyfingerprint.py\", line 372, in __readPacket\nException: The received packet is corrupted (the checksum is wrong)!\n```\nSolution - reduce baud rate\n\n# Documentation\n\n* [pyfingerprint](#.pyfingerprint)\n  * [FINGERPRINT\\_SETSYSTEMPARAMETER\\_BAUDRATE](#.pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_BAUDRATE)\n  * [FINGERPRINT\\_SETSYSTEMPARAMETER\\_SECURITY\\_LEVEL](#.pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_SECURITY_LEVEL)\n  * [FINGERPRINT\\_SETSYSTEMPARAMETER\\_PACKAGE\\_SIZE](#.pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_PACKAGE_SIZE)\n  * [FINGERPRINT\\_LED\\_BREATHING](#.pyfingerprint.FINGERPRINT_LED_BREATHING)\n  * [FINGERPRINT\\_LED\\_FLASHING](#.pyfingerprint.FINGERPRINT_LED_FLASHING)\n  * [FINGERPRINT\\_LED\\_CONTINUOUS](#.pyfingerprint.FINGERPRINT_LED_CONTINUOUS)\n  * [FINGERPRINT\\_LED\\_OFF](#.pyfingerprint.FINGERPRINT_LED_OFF)\n  * [FINGERPRINT\\_LED\\_GRADUAL\\_ON](#.pyfingerprint.FINGERPRINT_LED_GRADUAL_ON)\n  * [FINGERPRINT\\_LED\\_GRADUAL\\_OFF](#.pyfingerprint.FINGERPRINT_LED_GRADUAL_OFF)\n  * [FINGERPRINT\\_LED\\_RED](#.pyfingerprint.FINGERPRINT_LED_RED)\n  * [FINGERPRINT\\_LED\\_BLUE](#.pyfingerprint.FINGERPRINT_LED_BLUE)\n  * [FINGERPRINT\\_LED\\_PURPLE](#.pyfingerprint.FINGERPRINT_LED_PURPLE)\n  * [FINGERPRINT\\_CHARBUFFER1](#.pyfingerprint.FINGERPRINT_CHARBUFFER1)\n  * [FINGERPRINT\\_CHARBUFFER2](#.pyfingerprint.FINGERPRINT_CHARBUFFER2)\n  * [PyFingerprint](#.pyfingerprint.PyFingerprint)\n    * [\\_\\_init\\_\\_](#.pyfingerprint.PyFingerprint.__init__)\n    * [\\_\\_del\\_\\_](#.pyfingerprint.PyFingerprint.__del__)\n    * [verifyPassword](#.pyfingerprint.PyFingerprint.verifyPassword)\n    * [setPassword](#.pyfingerprint.PyFingerprint.setPassword)\n    * [setAddress](#.pyfingerprint.PyFingerprint.setAddress)\n    * [setSystemParameter](#.pyfingerprint.PyFingerprint.setSystemParameter)\n    * [setBaudRate](#.pyfingerprint.PyFingerprint.setBaudRate)\n    * [setSecurityLevel](#.pyfingerprint.PyFingerprint.setSecurityLevel)\n    * [setMaxPacketSize](#.pyfingerprint.PyFingerprint.setMaxPacketSize)\n    * [getSystemParameters](#.pyfingerprint.PyFingerprint.getSystemParameters)\n    * [getStorageCapacity](#.pyfingerprint.PyFingerprint.getStorageCapacity)\n    * [getSecurityLevel](#.pyfingerprint.PyFingerprint.getSecurityLevel)\n    * [getMaxPacketSize](#.pyfingerprint.PyFingerprint.getMaxPacketSize)\n    * [getBaudRate](#.pyfingerprint.PyFingerprint.getBaudRate)\n    * [getTemplateIndex](#.pyfingerprint.PyFingerprint.getTemplateIndex)\n    * [getTemplateCount](#.pyfingerprint.PyFingerprint.getTemplateCount)\n    * [readImage](#.pyfingerprint.PyFingerprint.readImage)\n    * [convertImage](#.pyfingerprint.PyFingerprint.convertImage)\n    * [createTemplate](#.pyfingerprint.PyFingerprint.createTemplate)\n    * [storeTemplate](#.pyfingerprint.PyFingerprint.storeTemplate)\n    * [searchTemplate](#.pyfingerprint.PyFingerprint.searchTemplate)\n    * [loadTemplate](#.pyfingerprint.PyFingerprint.loadTemplate)\n    * [deleteTemplate](#.pyfingerprint.PyFingerprint.deleteTemplate)\n    * [clearDatabase](#.pyfingerprint.PyFingerprint.clearDatabase)\n    * [compareCharacteristics](#.pyfingerprint.PyFingerprint.compareCharacteristics)\n    * [uploadCharacteristics](#.pyfingerprint.PyFingerprint.uploadCharacteristics)\n    * [generateRandomNumber](#.pyfingerprint.PyFingerprint.generateRandomNumber)\n    * [downloadCharacteristics](#.pyfingerprint.PyFingerprint.downloadCharacteristics)\n    * [softReset](#.pyfingerprint.PyFingerprint.softReset)\n    * [checkSensor](#.pyfingerprint.PyFingerprint.checkSensor)\n    * [handshake](#.pyfingerprint.PyFingerprint.handshake)\n    * [cancelInstruction](#.pyfingerprint.PyFingerprint.cancelInstruction)\n    * [ledOn](#.pyfingerprint.PyFingerprint.ledOn)\n    * [ledOff](#.pyfingerprint.PyFingerprint.ledOff)\n\n\u003ca name=\".pyfingerprint\"\u003e\u003c/a\u003e\n## pyfingerprint\n\nPyFingerprint\nCopyright (C) 2015 Bastian Raschke \u003cbastian.raschke@posteo.de\u003e\nAll rights reserved.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_BAUDRATE\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_SETSYSTEMPARAMETER\\_BAUDRATE\n\nSet the baud rate.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_SECURITY_LEVEL\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_SETSYSTEMPARAMETER\\_SECURITY\\_LEVEL\n\nSet the security level.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_SETSYSTEMPARAMETER_PACKAGE_SIZE\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_SETSYSTEMPARAMETER\\_PACKAGE\\_SIZE\n\nSet the package size.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_BREATHING\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_BREATHING\n\nBreathing LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_FLASHING\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_FLASHING\n\nFlashing LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_CONTINUOUS\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_CONTINUOUS\n\nContinuous LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_OFF\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_OFF\n\nLED off.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_GRADUAL_ON\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_GRADUAL\\_ON\n\nTurn LED on gradually.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_GRADUAL_OFF\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_GRADUAL\\_OFF\n\nTurn LED off gradually.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_RED\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_RED\n\nRed LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_BLUE\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_BLUE\n\nBlue LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_LED_PURPLE\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_LED\\_PURPLE\n\nPurple LED.\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_CHARBUFFER1\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_CHARBUFFER1\n\nChar buffer 1\n\n\u003ca name=\".pyfingerprint.FINGERPRINT_CHARBUFFER2\"\u003e\u003c/a\u003e\n#### FINGERPRINT\\_CHARBUFFER2\n\nChar buffer 2\n\n\u003ca name=\".pyfingerprint.PyFingerprint\"\u003e\u003c/a\u003e\n### PyFingerprint\n\n```python\nclass PyFingerprint(object)\n```\n\nManages ZhianTec fingerprint sensors.\n\n\u003ca name=\".pyfingerprint.PyFingerprint.__init__\"\u003e\u003c/a\u003e\n#### \\_\\_init\\_\\_\n\n```python\n | __init__(uart, address=0xFFFFFFFF, password=0x00000000)\n```\n\nConstructor.\n\n**Arguments**:\n\n- `uart` - Instance of machine.UART. The baud rate set in the UART\n  instance MUST be a multiple of 9600. Passing in a UART instance\n  enables different flavors of MicroPython to be supported.\n- `address` _int_ - The sensor address\n- `password` _int_ - The sensor password\n\n\n**Raises**:\n\n- `ValueError` - if address or password are invalid\n\n\u003ca name=\".pyfingerprint.PyFingerprint.__del__\"\u003e\u003c/a\u003e\n#### \\_\\_del\\_\\_\n\n```python\n | __del__()\n```\n\nDestructor.\n\n\u003ca name=\".pyfingerprint.PyFingerprint.verifyPassword\"\u003e\u003c/a\u003e\n#### verifyPassword\n\n```python\n | verifyPassword()\n```\n\nVerifies password of the sensor.\n\n**Returns**:\n\n  True if password is correct or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if an error occured\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setPassword\"\u003e\u003c/a\u003e\n#### setPassword\n\n```python\n | setPassword(newPassword)\n```\n\nSets the password of the sensor.\n\n**Arguments**:\n\n- `newPassword` _int_ - The new password to use.\n\n\n**Returns**:\n\n  True if password was set correctly or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if an error occured\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setAddress\"\u003e\u003c/a\u003e\n#### setAddress\n\n```python\n | setAddress(newAddress)\n```\n\nSets the sensor address.\n\n**Arguments**:\n\n- `newAddress` _int_ - The new address to use.\n\n\n**Returns**:\n\n  True if address was set correctly or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setSystemParameter\"\u003e\u003c/a\u003e\n#### setSystemParameter\n\n```python\n | setSystemParameter(parameterNumber, parameterValue)\n```\n\nSet a system parameter of the sensor.\n\n**Arguments**:\n\n- `parameterNumber` _int_ - The parameter number. Use one of `FINGERPRINT_SETSYSTEMPARAMETER_*` constants.\n- `parameterValue` _int_ - The value\n\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `ValueError` - if any passed parameter is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setBaudRate\"\u003e\u003c/a\u003e\n#### setBaudRate\n\n```python\n | setBaudRate(baudRate)\n```\n\nSets the baud rate.\n\n**Arguments**:\n\n- `baudRate` _int_ - The baud rate\n\n\n**Raises**:\n\n- `ValueError` - if passed baud rate is no multiple of 9600\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setSecurityLevel\"\u003e\u003c/a\u003e\n#### setSecurityLevel\n\n```python\n | setSecurityLevel(securityLevel)\n```\n\nSets the security level of the sensor.\n\n**Arguments**:\n\n- `securityLevel` _int_ - Value between 1 and 5 where 1 is lowest and 5 highest.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.setMaxPacketSize\"\u003e\u003c/a\u003e\n#### setMaxPacketSize\n\n```python\n | setMaxPacketSize(packetSize)\n```\n\nSets the maximum packet size of sensor.\n\n**Arguments**:\n\n- `packetSize` _int_ - 32, 64, 128 and 256 are supported.\n\n\n**Raises**:\n\n- `ValueError` - if passed packet size is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getSystemParameters\"\u003e\u003c/a\u003e\n#### getSystemParameters\n\n```python\n | getSystemParameters()\n```\n\nGets all available system information of the sensor.\n\n**Returns**:\n\n  A tuple that contains the following information:\n- `0` - integer(2 bytes) The status register.\n- `1` - integer(2 bytes) The system id.\n- `2` - integer(2 bytes) The storage capacity.\n- `3` - integer(2 bytes) The security level.\n- `4` - integer(4 bytes) The sensor address.\n- `5` - integer(2 bytes) The packet length.\n- `6` - integer(2 bytes) The baud rate.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getStorageCapacity\"\u003e\u003c/a\u003e\n#### getStorageCapacity\n\n```python\n | getStorageCapacity()\n```\n\nGets the sensor storage capacity.\n\n**Returns**:\n\n  The storage capacity (int).\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getSecurityLevel\"\u003e\u003c/a\u003e\n#### getSecurityLevel\n\n```python\n | getSecurityLevel()\n```\n\nGets the security level of the sensor.\n\n**Returns**:\n\n  The security level (int).\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getMaxPacketSize\"\u003e\u003c/a\u003e\n#### getMaxPacketSize\n\n```python\n | getMaxPacketSize()\n```\n\nGets the maximum allowed size of a single packet.\n\n**Returns**:\n\n  Return the max size (int).\n\n\n**Raises**:\n\n- `ValueError` - if packet size is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getBaudRate\"\u003e\u003c/a\u003e\n#### getBaudRate\n\n```python\n | getBaudRate()\n```\n\nGets the baud rate.\n\n**Returns**:\n\n  The baud rate (int).\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getTemplateIndex\"\u003e\u003c/a\u003e\n#### getTemplateIndex\n\n```python\n | getTemplateIndex(page)\n```\n\nGets a list of the template positions with usage indicator.\n\n**Arguments**:\n\n- `page` _int_ - The page (value between 0 and 3).\n\n\n**Returns**:\n\n  The list.\n\n\n**Raises**:\n\n- `ValueError` - if passed page is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.getTemplateCount\"\u003e\u003c/a\u003e\n#### getTemplateCount\n\n```python\n | getTemplateCount()\n```\n\nGets the number of stored templates.\n\n**Returns**:\n\n  The template count (int).\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.readImage\"\u003e\u003c/a\u003e\n#### readImage\n\n```python\n | readImage()\n```\n\nReads the image of a finger and stores it in image buffer.\n\n**Returns**:\n\n  True if image was read successfully or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.convertImage\"\u003e\u003c/a\u003e\n#### convertImage\n\n```python\n | convertImage(charBufferNumber=FINGERPRINT_CHARBUFFER1)\n```\n\nConverts the image in image buffer to characteristics and stores it in specified char buffer.\n\n**Arguments**:\n\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `ValueError` - if passed char buffer is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.createTemplate\"\u003e\u003c/a\u003e\n#### createTemplate\n\n```python\n | createTemplate()\n```\n\nCombines the characteristics which are stored in char buffer 1 and char buffer 2 into one template.\nThe created template will be stored again in char buffer 1 and char buffer 2 as the same.\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.storeTemplate\"\u003e\u003c/a\u003e\n#### storeTemplate\n\n```python\n | storeTemplate(positionNumber=-1, charBufferNumber=FINGERPRINT_CHARBUFFER1)\n```\n\nStores a template from the specified char buffer at the given position.\n\n**Arguments**:\n\n- `positionNumber` _int_ - The position\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n\n\n**Returns**:\n\n  The position number (int) of the stored template.\n\n\n**Raises**:\n\n- `ValueError` - if passed position or char buffer is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.searchTemplate\"\u003e\u003c/a\u003e\n#### searchTemplate\n\n```python\n | searchTemplate(charBufferNumber=FINGERPRINT_CHARBUFFER1, positionStart=0, count=-1)\n```\n\nSearches inside the database for the characteristics in char buffer.\n\n**Arguments**:\n\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n- `positionStart` _int_ - The position to start the search\n- `count` _int_ - The number of templates\n\n\n**Returns**:\n\n  A tuple that contain the following information:\n- `0` - integer(2 bytes) The position number of found template.\n- `1` - integer(2 bytes) The accuracy score of found template.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.loadTemplate\"\u003e\u003c/a\u003e\n#### loadTemplate\n\n```python\n | loadTemplate(positionNumber, charBufferNumber=FINGERPRINT_CHARBUFFER1)\n```\n\nLoads an existing template specified by position number to specified char buffer.\n\n**Arguments**:\n\n- `positionNumber` _int_ - The position\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `ValueError` - if passed position or char buffer is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.deleteTemplate\"\u003e\u003c/a\u003e\n#### deleteTemplate\n\n```python\n | deleteTemplate(positionNumber, count=1)\n```\n\nDeletes templates from fingerprint database. Per default one.\n\n**Arguments**:\n\n- `positionNumber` _int_ - The position\n- `count` _int_ - The number of templates to be deleted.\n\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `ValueError` - if passed position or count is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.clearDatabase\"\u003e\u003c/a\u003e\n#### clearDatabase\n\n```python\n | clearDatabase()\n```\n\nDeletes all templates from the fingeprint database.\n\n**Returns**:\n\n  True if successful or False otherwise.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.compareCharacteristics\"\u003e\u003c/a\u003e\n#### compareCharacteristics\n\n```python\n | compareCharacteristics()\n```\n\nCompare the finger characteristics of char buffer 1 with char buffer 2 and returns the accuracy score.\n\n**Returns**:\n\n  The accuracy score (int). 0 means fingers are not the same.\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.uploadCharacteristics\"\u003e\u003c/a\u003e\n#### uploadCharacteristics\n\n```python\n | uploadCharacteristics(charBufferNumber=FINGERPRINT_CHARBUFFER1, characteristicsData=[0])\n```\n\nUploads finger characteristics to specified char buffer.\n\nAuthor:\nDavid Gilson \u003cdavgilson@live.fr\u003e\n\n**Arguments**:\n\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n- `characteristicsData` _list_ - The characteristics\n\n\n**Returns**:\n\n  True if everything is right.\n\n\n**Raises**:\n\n- `ValueError` - if passed char buffer or characteristics are invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.generateRandomNumber\"\u003e\u003c/a\u003e\n#### generateRandomNumber\n\n```python\n | generateRandomNumber()\n```\n\nGenerates a random 32-bit decimal number.\n\nAuthor:\nPhilipp Meisberger \u003cteam@pm-codeworks.de\u003e\n\n**Returns**:\n\n  The generated random number (int).\n\n\n**Raises**:\n\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.downloadCharacteristics\"\u003e\u003c/a\u003e\n#### downloadCharacteristics\n\n```python\n | downloadCharacteristics(charBufferNumber=FINGERPRINT_CHARBUFFER1)\n```\n\nDownloads the finger characteristics from the specified char buffer.\n\n**Arguments**:\n\n- `charBufferNumber` _int_ - The char buffer. Use `FINGERPRINT_CHARBUFFER1` or `FINGERPRINT_CHARBUFFER2`.\n- `characteristicsData` _list_ - The characteristics\n\n\n**Returns**:\n\n  The characteristics (list).\n\n\n**Raises**:\n\n- `ValueError` - if passed char buffer is invalid\n- `Exception` - if any error occurs\n\n\u003ca name=\".pyfingerprint.PyFingerprint.softReset\"\u003e\u003c/a\u003e\n#### softReset\n\n```python\n | softReset()\n```\n\nSoft reset the sensor.\n\nAuthor:\n    Chris Borrill \u003cchris.borrill@gmail.com\u003e\n\n\u003ca name=\".pyfingerprint.PyFingerprint.checkSensor\"\u003e\u003c/a\u003e\n#### checkSensor\n\n```python\n | checkSensor()\n```\n\nCheck the sensor is in a working state.\n\nAuthor:\nChris Borrill \u003cchris.borrill@gmail.com\u003e\n\n**Returns**:\n\n  True if the sensor is working correctly.\n\n\u003ca name=\".pyfingerprint.PyFingerprint.handshake\"\u003e\u003c/a\u003e\n#### handshake\n\n```python\n | handshake()\n```\n\nHand sake with the sensor.\n\nAuthor:\nChris Borrill \u003cchris.borrill@gmail.com\u003e\n\n**Returns**:\n\n  True if the sensor is working normally.\n\n\u003ca name=\".pyfingerprint.PyFingerprint.cancelInstruction\"\u003e\u003c/a\u003e\n#### cancelInstruction\n\n```python\n | cancelInstruction()\n```\n\nCancel last intruction to the sensor.\n\nAuthor:\n    Chris Borrill \u003cchris.borrill@gmail.com\u003e\n\n\u003ca name=\".pyfingerprint.PyFingerprint.ledOn\"\u003e\u003c/a\u003e\n#### ledOn\n\n```python\n | ledOn(colour=FINGERPRINT_LED_RED, control=FINGERPRINT_LED_BREATHING, flashSpeed=0x7D, flashCount=0x00)\n```\n\nTurn on sensor LED.\n\nAuthor:\nChris Borrill \u003cchris.borrill@gmail.com\u003e\n\n**Arguments**:\n\n- `colour` - one of FINGERPRINT_LED_RED (default), FINGERPRINT_LED_BLUE,\n  FINGERPRINT_LED_PURPLE\n- `control` - one of FINGERPRINT_LED_BREATHING (default),\n  FINGERPRINT_LED_BLUE, FINGERPRINT_LED_PURPLE\n  FINGERPRINT_LED_CONTINUOUS, FINGERPRINT_LED_OFF,\n  FINGERPRINT_LED_GRADUAL_ON, FINGERPRINT_LED_GRADUAL_OFF\n- `flashSpeed` - 0 (fast) to 255 (slow) (default 125)\n- `flashCount` - 0 (infinite) to 255 (default 0)\n\n\n**Raises**:\n\n- `Exception` - if an error occured\n\n\u003ca name=\".pyfingerprint.PyFingerprint.ledOff\"\u003e\u003c/a\u003e\n#### ledOff\n\n```python\n | ledOff()\n```\n\nTurn off sensor LED.\n\nAuthor:\nChris Borrill \u003cchris.borrill@gmail.com\u003e\n\n**Raises**:\n\n- `Exception` - if an error occured\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Sensors"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisb2%2Fmicropython-fingerprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisb2%2Fmicropython-fingerprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisb2%2Fmicropython-fingerprint/lists"}