nanoFramework.Iot.Device.AtomQrCode 1.1.907

Prefix Reserved
dotnet add package nanoFramework.Iot.Device.AtomQrCode --version 1.1.907
                    
NuGet\Install-Package nanoFramework.Iot.Device.AtomQrCode -Version 1.1.907
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.AtomQrCode" Version="1.1.907" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.AtomQrCode" Version="1.1.907" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.AtomQrCode" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.AtomQrCode --version 1.1.907
                    
#r "nuget: nanoFramework.Iot.Device.AtomQrCode, 1.1.907"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.AtomQrCode@1.1.907
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.AtomQrCode&version=1.1.907
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.AtomQrCode&version=1.1.907
                    
Install as a Cake Tool

M5Stack ATOM QR Code reader

This is a library to interact with the ATOM QR Code reader from M5Stack.

atom-qr-reader.png

Documentation

  • The module documentation can be found here

Usage

Important: make sure you properly setup the UART pins for ESP32 before creating the QrCodeReader. For this, make sure you install the nanoFramework.Hardware.ESP32 NuGet:

///////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the UART GPIOs
// the GPIOs below are the ones from the ATOM device that's part of the
// ATOM QR Code reader kit from M5Stack.
Configuration.SetPinFunction(22, DeviceFunction.COM2_RX);
Configuration.SetPinFunction(19, DeviceFunction.COM2_TX);

For other devices, like STM32, please make sure you're using the pins for the UART you want to use.

using Iot.Device.AtomQrCode;
using nanoFramework.Hardware.Esp32;

// reader is connected to COM2
QrCodeReader reader = new QrCodeReader("COM2");

The reader offers various options to work with. Let's explore the most common usage scenarios.

Reading a barcode

To perform readings "on-demand" the trigger mode has to be set to Host and then calling TryReadBarcode().

// set scan mode to HOST so it reads on request
reader.TriggerMode = TriggerMode.Host;

// try reading barcode
string code;

if (reader.TryReadBarcode(out code))
{
    Debug.WriteLine(code);
}
else
{
    Debug.WriteLine("*** failed to read barcode ***");
}

Upon successful decoding a barcode, it will return the barcode data. On failure an empty string is returned.

Continuous scanning

For random readings when there is no previous knowledge when there is barcode present (for example on a kiosk) one has to set the trigger mode to Automatic, setup an event handler and then call StartScanning().

// set scan mode to AUTOSENSING 
reader.TriggerMode = TriggerMode.Autosensing;

// setup handler
reader.BarcodeDataAvailable += Reader_BarcodeDataAvailable;

// start scanning
reader.StartScanning();

The scanner will detect changes in the brightness of the surroundings and will trigger a reading when the brightness changes. Upon successful decoding a barcode, an event is triggered with the barcode data on the respective argument.

void Reader_BarcodeDataAvailable(object sender, BarcodeDataAvailableEventArgs e)
{
    Debug.WriteLine("*** barcode data received ***");
    Debug.WriteLine(e.BarcodeData);
}

Settings and configurations

The library exposes several configurations and working options for the reader through properties and commands. Please explore the documentation here.

Acknowledgments

The development of this library was kindly sponsored by greenYng!

greenyng-logo.png

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.907 162 10/2/2025
1.1.880 251 4/24/2025
1.1.864 219 4/2/2025
1.1.852 244 3/11/2025
1.1.838 186 3/3/2025
1.1.822 192 2/26/2025
1.1.790 176 2/5/2025
1.1.775 180 2/4/2025
1.1.772 171 2/4/2025
1.1.755 204 1/31/2025
1.1.737 133 1/13/2025
1.1.729 134 1/8/2025
1.1.696 171 12/16/2024
1.1.673 188 10/23/2024
1.1.631 196 8/28/2024
1.1.570 199 6/14/2024
1.1.548 178 5/15/2024
1.1.536 212 4/15/2024
1.1.436 302 11/10/2023
1.1.329 267 5/26/2023
1.1.313 270 5/12/2023
1.1.297 265 5/3/2023
1.1.203 415 12/28/2022
1.1.153 492 11/5/2022
1.1.141 479 10/25/2022
1.1.128 496 10/22/2022
1.1.117 513 10/10/2022
1.1.114 504 10/8/2022
1.1.89 531 9/16/2022
1.1.35 503 8/4/2022
1.0.82.2032 499 6/23/2022
1.0.78.32999 523 6/16/2022
1.0.66.17326 540 6/13/2022
1.0.36.25390 504 5/27/2022
1.0.27.10097 521 5/23/2022
1.0.18.6580 545 5/19/2022
1.0.6 540 5/3/2022
1.0.3 523 5/2/2022
1.0.1 491 5/2/2022