Compare commits
2 Commits
e602fb26c7
...
b9cc6e0aac
| Author | SHA1 | Date | |
|---|---|---|---|
| b9cc6e0aac | |||
| 2a413fb9fb |
68
README.md
68
README.md
@@ -0,0 +1,68 @@
|
||||
# Waveshare UART fingerprint sensor (C)
|
||||
|
||||
A C# library for the [**Waveshare UART fingerprint sensor (C)**][Sensor], running on
|
||||
.Net Framework 4.7 (**Mono**) on a **Raspberry Pi**
|
||||
|
||||
This library is tested using a Raspberry Pi Zero (hence the use of Mono)
|
||||
but should work on any Raspberry.
|
||||
It should also be easily portable to any device that supports Mono
|
||||
or an equivalent (*.Net Core*).
|
||||
|
||||
## Usage
|
||||
|
||||
- First install it from [**nuget**](https://www.nuget.org/packages/WaveshareUARTFingerprintSensor/)
|
||||
|
||||
Then you only need to start the sensor
|
||||
|
||||
```csharp
|
||||
// PrimarySerialPort refers to /dev/ttyAMA0
|
||||
// SecondarySerialPort refers to /dev/ttyS0
|
||||
// You need to choose it according to your Raspberry
|
||||
// Check the table below
|
||||
var sensor = new FingerprintSensor(FingerprintSensor.PrimarySerialPort);
|
||||
|
||||
sensor.Start();
|
||||
|
||||
// Do any command
|
||||
|
||||
// Example: get the user count
|
||||
if (sensor.TryGetUserCount(out ushort count))
|
||||
{
|
||||
Console.WriteLine($"User count: {count}");
|
||||
}
|
||||
```
|
||||
|
||||
Here is a table of which serial port to use on which Raspberry Pi,
|
||||
it may be different for you
|
||||
| Model | Port |
|
||||
| --------- | ---------------------- |
|
||||
| Pi Zero | Primary (/dev/ttyAMA0) |
|
||||
| Pi Zero W | Secondary (/dev/ttyS0) |
|
||||
| Pi 1 | Primary (/dev/ttyAMA0) |
|
||||
| Pi 2 | Primary (/dev/ttyAMA0) |
|
||||
| Pi 3 | Secondary (/dev/ttyS0) |
|
||||
| Pi Zero 4 | Secondary (/dev/ttyS0) |
|
||||
|
||||
> The Secondary UART is **disabled by default**, you an activate it in `raspi-config`
|
||||
> [**Source**](https://www.raspberrypi.org/documentation/configuration/uart.md)
|
||||
|
||||
## Sample App
|
||||
|
||||
You can find a [**sample app**](WaveshareUARTFingerprintSensor.Sample) which shows basic usages of
|
||||
this library and may help you to understand how to use it
|
||||
|
||||
## Contributing
|
||||
|
||||
If you have a feature idea or want to report a bug, don't hesitate to create a new
|
||||
[**Issue**](https://github.com/Eveldee/WaveshareUARTFingerprintSensor/issues) or do a
|
||||
[**Pull Request**](https://github.com/Eveldee/WaveshareUARTFingerprintSensor/pulls)
|
||||
|
||||
## Copyright and license
|
||||
|
||||
*[**WaveshareUARTFingerprintSensor**](README.md)* library is licensed under the [MIT License](LICENSE).
|
||||
|
||||
*[**Unosquare.Raspberry.IO**](https://github.com/migueldeicaza/gui.cs/)* library is under the [MIT License](https://github.com/unosquare/raspberryio/blob/master/LICENSE).
|
||||
|
||||
|
||||
<!-- Links -->
|
||||
[Sensor]: https://www.waveshare.com/wiki/UART_Fingerprint_Sensor_(C)
|
||||
BIN
Sample.png
Normal file
BIN
Sample.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
22
WaveshareUARTFingerprintSensor.Sample/README.md
Normal file
22
WaveshareUARTFingerprintSensor.Sample/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Sample App
|
||||
|
||||
A sample app for the [Waveshare UART fingerprint sensor (C) library](../README.md)
|
||||
|
||||

|
||||
|
||||
## Build
|
||||
|
||||
You can compile it using any **C# IDE** that supports **.Net Framework** or by running
|
||||
`dotnet build` in a **terminal** using [**.Net CLI**](https://docs.microsoft.com/en-us/dotnet/core/tools/)
|
||||
|
||||
## Usage
|
||||
|
||||
- Install [**Mono**](https://www.mono-project.com/) on your Raspberry Pi
|
||||
- [**Download**](https://github.com/Eveldee/WaveshareUARTFingerprintSensor/releases) or [**Build**](#build) the application
|
||||
- Run it with `mono WaveshareUARTFingerprintSensor.Sample.exe`
|
||||
|
||||
## Copyright and license
|
||||
|
||||
*[**WaveshareUARTFingerprintSensor**](../README.md)* library is licensed under the [MIT License](../LICENSE).
|
||||
|
||||
*[**gui.cs**](https://github.com/migueldeicaza/gui.cs/)* library is under the [MIT License](https://github.com/migueldeicaza/gui.cs/blob/master/LICENSE).
|
||||
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
|
||||
// Les informations générales relatives à un assembly dépendent de
|
||||
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
|
||||
// associées à un assembly.
|
||||
[assembly: AssemblyTitle("WaveshareUARTFingerprintSensor")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyTitle("Waveshare UART Fingerprint Sensor (C)")]
|
||||
[assembly: AssemblyDescription("C# library for the Waveshare UART fingerprint sensor (C)")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("Ilyx")]
|
||||
[assembly: AssemblyProduct("WaveshareUARTFingerprintSensor")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>$id$</id>
|
||||
<version>$version$</version>
|
||||
<title>Waveshare UART Fingerprint Sensor</title>
|
||||
<authors>Eveldee</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<projectUrl>https://github.com/Eveldee/WaveshareUARTFingerprintSensor</projectUrl>
|
||||
<!-- <iconUrl>http://icon_url_here_or_delete_this_line/</iconUrl> -->
|
||||
<description>C# library for the Waveshare UART fingerprint sensor (C)</description>
|
||||
<releaseNotes>Initial version.</releaseNotes>
|
||||
<copyright>$copyright$</copyright>
|
||||
<tags>Fingerprint Sensor Waveshare UART</tags>
|
||||
</metadata>
|
||||
</package>
|
||||
Reference in New Issue
Block a user