nanoFramework.Iot.Device.Ft6xx6x 1.2.615

前缀已保留
dotnet add package nanoFramework.Iot.Device.Ft6xx6x --version 1.2.615                
NuGet\Install-Package nanoFramework.Iot.Device.Ft6xx6x -Version 1.2.615                
此命令旨在在 Visual Studio 的包管理器控制台中使用,因为它使用了 NuGet 模块的 Install-Package 版本。
<PackageReference Include="nanoFramework.Iot.Device.Ft6xx6x" Version="1.2.615" />                
对支持 PackageReference 的项目,请将此 XML 节点复制到项目文件中以便引用包。
paket add nanoFramework.Iot.Device.Ft6xx6x --version 1.2.615                
#r "nuget: nanoFramework.Iot.Device.Ft6xx6x, 1.2.615"                
#r 指令可以在 F# Interactive 和 Polyglot Notebooks 中使用。将此内容复制到交互工具或脚本的源代码中引用包。
// Install nanoFramework.Iot.Device.Ft6xx6x as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Ft6xx6x&version=1.2.615

// Install nanoFramework.Iot.Device.Ft6xx6x as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Ft6xx6x&version=1.2.615                

Ft6xx6x/Ft6336GU - 触摸屏控制器

FT6xx6x 是触摸屏控制器。M5Core2 有一个 FT6336U。此驱动支持 FT6236G、FT6336G、FT6336U 和 FT6426。示例已使用 M5Core2 构建和测试。

文档

使用方法

重要:在创建 I2cDevice 之前,请确保正确设置 I2C 引脚,尤其是对于 ESP32,请确保已安装 nanoFramework.Hardware.ESP32 nuget

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

对于 STM32 等其他设备,请确保您正在使用您想要使用的 I2C 总线的预设引脚。

注意:此示例需要 M5Core2。如果您想要使用其他设备,只需删除所有相关的 nuget。

M5Core2.InitializeScreen();
I2cConnectionSettings settings = new(1, Ft6xx6x.DefaultI2cAddress);
using I2cDevice device = I2cDevice.Create(settings);
using GpioController gpio = new();

using Ft6xx6x sensor = new(device);
var ver = sensor.GetVersion();
Debug.WriteLine($"version: {ver}");
sensor.SetInterruptMode(false);
Debug.WriteLine($"Period active: {sensor.PeriodActive}");
Debug.WriteLine($"Period active in monitor mode: {sensor.MonitorModePeriodActive}");
Debug.WriteLine($"Time to enter monitor: {sensor.MonitorModeDelaySeconds} seconds");
Debug.WriteLine($"Monitor mode: {sensor.MonitorModeEnabled}");
Debug.WriteLine($"Proximity sensing: {sensor.ProximitySensingEnabled}");

gpio.OpenPin(39, PinMode.Input);
// This will enable an event on GPIO39 on falling edge when the screen if touched
gpio.RegisterCallbackForPinValueChangedEvent(39, PinEventTypes.Falling, TouchInterrupCallback);

while (true)
{
    Thread.Sleep(20);
}

void TouchInterrupCallback(object sender, PinValueChangedEventArgs pinValueChangedEventArgs)
{
    Debug.WriteLine("Touch interrupt");
    var points = sensor.GetNumberPoints();
    if (points == 1)
    {
        var point = sensor.GetPoint(true);
                // Some controllers supports as well events, you can get access to them as well thru point.Event
        Debug.WriteLine($"ID: {point.TouchId}, X: {point.X}, Y: {point.Y}, Weight: {point.Weigth}, Misc: {point.Miscelaneous}");
    }
    else if (points == 2)
    {
        var dp = sensor.GetDoublePoints();
        Debug.WriteLine($"ID: {dp.Point1.TouchId}, X: {dp.Point1.X}, Y: {dp.Point1.Y}, Weight: {dp.Point1.Weigth}, Misc: {dp.Point1.Miscelaneous}");
        Debug.WriteLine($"ID: {dp.Point2.TouchId}, X: {dp.Point2.X}, Y: {dp.Point2.Y}, Weight: {dp.Point2.Weigth}, Misc: {dp.Point2.Miscelaneous}");
    }
}
产品 兼容和附加的目标框架版本。
.NET Framework net 是兼容的。
兼容目标框架
包含目标框架(在包中)
更多关于目标框架.NET Standard的信息。

NuGet包 (1)

显示依赖nanoFramework.Iot.Device.Ft6xx6x的Top 1 NuGet包

下载
nanoFramework.M5Core2

此包包含适用于.NET nanoFramework C#项目的nanoFramework.M5Core2程序集。

GitHub仓库 (1)

显示依赖nanoFramework.Iot.Device.Ft6xx6x的Top 1个流行的GitHub仓库

仓库
nanoframework/nanoFramework.IoT.Device
📦 此仓库包含各种传感器、芯片、显示器、帽子和驱动程序的.NET nanoFramework实现
版本 下载 最后更新
1.2.615 79 8/10/2024
1.2.422 1,795 11/9/2023
1.2.420 107 11/9/2023
1.2.316 2,032 5/16/2023
1.2.278 795 3/29/2023
1.2.204 3,255 12/29/2022
1.2.141 2,329 10/25/2022
1.2.82 3,603 9/14/2022
1.1.113.2032 8,084 6/23/2022
1.1.28 6,942 4/26/2022
1.1.25 739 4/25/2022
1.1.24 750 4/24/2022
1.1.23 731 4/23/2022
1.1.22 1,036 4/22/2022
1.1.21 431 4/21/2022
1.1.18 1,027 4/21/2022
1.1.17 734 4/20/2022
1.1.11 420 4/19/2022
1.1.7 1,025 4/18/2022
1.1.6 748 4/17/2022
1.1.5 756 4/16/2022
1.1.4 762 4/15/2022
1.1.1 432 4/14/2022
1.0.300 1,973 3/31/2022
1.0.21-preview.116 135 3/25/2022
1.0.21-preview.38 318 1/31/2022
1.0.21-preview.35 173 1/30/2022
1.0.21-preview.34 139 1/29/2022
1.0.21-preview.33 137 1/28/2022
1.0.21-preview.29 136 1/28/2022
1.0.21-preview.28 152 1/28/2022
1.0.21-preview.26 145 1/27/2022
1.0.21-preview.24 133 1/27/2022
1.0.21-preview.23 139 1/27/2022
1.0.21-preview.22 136 1/27/2022
1.0.21-preview.20 141 1/27/2022
1.0.21-preview.17 129 1/26/2022
1.0.21-preview.16 145 1/25/2022
1.0.21-preview.7 128 1/22/2022
1.0.21-preview.5 133 1/21/2022
1.0.21-preview.3 133 1/21/2022
1.0.21-preview.2 135 1/21/2022
1.0.21-preview.1 130 1/21/2022
1.0.20 460 1/19/2022
1.0.15 432 1/15/2022
1.0.10 287 1/11/2022
1.0.1 475 12/28/2021