Aggiungere i file di progetto.
This commit is contained in:
25
FT232H.sln
Normal file
25
FT232H.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35818.85 d17.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "FT232H", "FT232H\FT232H.vbproj", "{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {090511F9-77B5-440F-911F-014C1070ED9B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
58
FT232H/App.config
Normal file
58
FT232H/App.config
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.2.0" newVersion="6.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Ports" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.3.0" newVersion="4.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Bcl.HashCode" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
242
FT232H/FT232H.vbproj
Normal file
242
FT232H/FT232H.vbproj
Normal file
@@ -0,0 +1,242 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{86A59897-E612-4EB1-A4BC-0BB1DBF7E23B}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<StartupObject>FT232H.My.MyApplication</StartupObject>
|
||||
<RootNamespace>FT232H</RootNamespace>
|
||||
<AssemblyName>FT232H</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>FT232H.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>FT232H.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=4.8.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Autofac.4.8.1\lib\net45\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HidSharp, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HidSharp.2.1.0\lib\net35\HidSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iot.Device.Bindings, Version=3.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Iot.Device.Bindings.3.2.0\lib\netstandard2.0\Iot.Device.Bindings.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LibreHardwareMonitorLib, Version=0.9.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LibreHardwareMonitorLib.0.9.4\lib\net472\LibreHardwareMonitorLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.3\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.HashCode, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.HashCode.6.0.0\lib\net462\Microsoft.Bcl.HashCode.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.3\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.3, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.9.0.3\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Registry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Powell.Devices, Version=1.0.6.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Powell.Devices.1.0.6\lib\netstandard2.0\Powell.Devices.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Powell.Devices.Things.ADS111x, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Powell.Devices.Things.ADS111x.1.0.2\lib\netstandard2.0\Powell.Devices.Things.ADS111x.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Powell.Shared, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Powell.Shared.1.0.0\lib\netstandard2.0\Powell.Shared.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.CodeDom, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.CodeDom.9.0.3\lib\net462\System.CodeDom.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Device.Gpio, Version=3.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Device.Gpio.3.2.0\lib\netstandard2.0\System.Device.Gpio.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.9.0.3\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.9.0.3\lib\net462\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipelines, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.9.0.3\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Ports, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Ports.9.0.3\lib\net462\System.IO.Ports.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.2\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.TypeExtensions.4.5.1\lib\net461\System.Reflection.TypeExtensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.1\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.AccessControl, Version=6.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.AccessControl.6.0.1\lib\net461\System.Security.AccessControl.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal.Windows, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.Web" />
|
||||
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.9.0.3\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=9.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.9.0.3\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.2\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="UnitsNet, Version=5.0.0.0, Culture=neutral, PublicKeyToken=f8601875a1f041da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\UnitsNet.5.73.0\lib\netstandard2.0\UnitsNet.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="TemperatureReader.vb" />
|
||||
<Compile Include="Form1.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.vb">
|
||||
<DependentUpon>Form1.vb</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LCD_i2c.vb" />
|
||||
<Compile Include="Module1.vb" />
|
||||
<Compile Include="Modulo_ft232H.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ILLink\ILLink.Descriptors.LibraryBuild.xml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Import Project="..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets" Condition="Exists('..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.WindowsRuntime.4.7.0\build\net461\System.Runtime.WindowsRuntime.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
|
||||
</Project>
|
||||
85
FT232H/Form1.Designer.vb
generated
Normal file
85
FT232H/Form1.Designer.vb
generated
Normal file
@@ -0,0 +1,85 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class Form1
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Richiesto da Progettazione Windows Form
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTA: la procedura che segue è richiesta da Progettazione Windows Form
|
||||
'Può essere modificata in Progettazione Windows Form.
|
||||
'Non modificarla mediante l'editor del codice.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.TextBox1 = New System.Windows.Forms.TextBox()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.Button2 = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'Timer1
|
||||
'
|
||||
Me.Timer1.Interval = 1000
|
||||
'
|
||||
'TextBox1
|
||||
'
|
||||
Me.TextBox1.BackColor = System.Drawing.SystemColors.MenuHighlight
|
||||
Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, CType(0, Byte))
|
||||
Me.TextBox1.ForeColor = System.Drawing.SystemColors.Window
|
||||
Me.TextBox1.Location = New System.Drawing.Point(25, 24)
|
||||
Me.TextBox1.MaxLength = 80
|
||||
Me.TextBox1.Multiline = True
|
||||
Me.TextBox1.Name = "TextBox1"
|
||||
Me.TextBox1.Size = New System.Drawing.Size(417, 141)
|
||||
Me.TextBox1.TabIndex = 0
|
||||
'
|
||||
'Button1
|
||||
'
|
||||
Me.Button1.Location = New System.Drawing.Point(479, 24)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button1.TabIndex = 1
|
||||
Me.Button1.Text = "Button1"
|
||||
Me.Button1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Button2
|
||||
'
|
||||
Me.Button2.Location = New System.Drawing.Point(479, 53)
|
||||
Me.Button2.Name = "Button2"
|
||||
Me.Button2.Size = New System.Drawing.Size(75, 23)
|
||||
Me.Button2.TabIndex = 2
|
||||
Me.Button2.Text = "Button2"
|
||||
Me.Button2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Form1
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Button2)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.Controls.Add(Me.TextBox1)
|
||||
Me.Name = "Form1"
|
||||
Me.Text = "Form1"
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents Timer1 As Timer
|
||||
Friend WithEvents TextBox1 As TextBox
|
||||
Friend WithEvents Button1 As Button
|
||||
Friend WithEvents Button2 As Button
|
||||
End Class
|
||||
123
FT232H/Form1.resx
Normal file
123
FT232H/Form1.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="Timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
153
FT232H/Form1.vb
Normal file
153
FT232H/Form1.vb
Normal file
@@ -0,0 +1,153 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Management
|
||||
Imports Iot.Device.Ads1115
|
||||
Imports UnitsNet
|
||||
Public Class Form1
|
||||
Dim lcd As LCD_i2c
|
||||
Dim ads As Ads1115
|
||||
Dim config As Byte()
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
'Module1.Main()
|
||||
Dim dis = Modulo_ft232H.SelezionaDispositivo("FTAI6ATR")
|
||||
Dim lista = Modulo_ft232H.ElencoDispositivi(dis)
|
||||
Dim result As String = String.Join(",", lista)
|
||||
Console.WriteLine(result)
|
||||
'Dim lcd_i2c = Modulo_ft232H.SelezionaDispositivo("FTAI6ATR", &H27)
|
||||
|
||||
Dim lcd_i2c = Modulo_ft232H.SelezionaDispositivo(dis, &H27)
|
||||
lcd = New LCD_i2c(lcd_i2c)
|
||||
lcd.lcdSetCursor(0, 0)
|
||||
lcd.lcdPrint("dispositivi address:")
|
||||
lcd.lcdSetCursor(1, 0)
|
||||
lcd.lcdPrint(result)
|
||||
TextBox1.Font = New Font("5x8 LCD HD44780U A02", 20, FontStyle.Regular)
|
||||
|
||||
' Misura la larghezza di un singolo carattere
|
||||
Dim characterWidth As Single = TextBox1.CreateGraphics().MeasureString("A", TextBox1.Font).Width
|
||||
|
||||
' Calcola la larghezza desiderata per 20 caratteri
|
||||
Dim desiredWidth As Integer = CInt(characterWidth * 14)
|
||||
|
||||
' Aggiungi un margine extra per i bordi (ad esempio 10px per lato)
|
||||
Dim margin As Integer = 10
|
||||
TextBox1.Width = desiredWidth
|
||||
|
||||
|
||||
|
||||
' Seleziona ADS1115 su indirizzo 0x48
|
||||
'ads = Modulo_ft232H.SelezionaDispositivo(dis, &H48)
|
||||
|
||||
ads = New Ads1115(Modulo_ft232H.SelezionaDispositivo(dis, &H48), MeasuringRange.FS6144)
|
||||
' CONFIG: AIN0 rispetto a GND, ±4.096V, Continuous Mode, 128 SPS
|
||||
'
|
||||
Dim config As Byte() = {&H81, &H0}
|
||||
' AIN0 rispetto a GND, PGA ±6.144V, Continuous Mode, 128 SPS
|
||||
'ads.Write(config)
|
||||
|
||||
|
||||
|
||||
|
||||
' Verifica la configurazione
|
||||
'ads.Write({&H1}) ' Seleziona il registro CONFIG
|
||||
'Dim configData As Byte() = New Byte(1) {}
|
||||
'ads.Read(configData)
|
||||
' Legge dal canale AIN0 rispetto a GND in modalità single-shot
|
||||
Dim valore As Double = LeggiADC()
|
||||
Console.WriteLine("Valore ADC: " & valore.ToString("F4") & " V")
|
||||
Threading.Thread.Sleep(500)
|
||||
Threading.Thread.Sleep(10) ' Attendi almeno 10ms prima di leggere
|
||||
Timer1.Interval = 500
|
||||
Timer1.Start()
|
||||
lcd.lcdClear()
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Closed(sender As Object, e As EventArgs) Handles Me.Closed
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
|
||||
Timer1.Stop()
|
||||
lcd.lcdClear()
|
||||
lcd.lcdPrint("programma chiuso")
|
||||
End Sub
|
||||
Dim testo = "ads"
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
||||
' Ottieni l'ora corrente
|
||||
Dim oraCorrente As String = DateTime.Now.ToString("HH:mm:ss")
|
||||
Select Case testo
|
||||
Case "ads"
|
||||
AggiornaTextBoxConPosizione("valore: " + LeggiADC().ToString("F2"), 3)
|
||||
Case "temp"
|
||||
Dim reader As New TemperatureReader()
|
||||
AggiornaTextBoxConPosizione(reader.GetCpuTemperature(), 3)
|
||||
End Select
|
||||
AggiornaTextBoxConPosizione(oraCorrente, 2)
|
||||
End Sub
|
||||
Sub temperatura()
|
||||
Try
|
||||
Dim searcher As New ManagementObjectSearcher("root\WMI", "SELECT * FROM MSAcpi_ThermalZoneTemperature")
|
||||
|
||||
For Each queryObj As ManagementObject In searcher.Get()
|
||||
Dim tempKelvin As Double = CDbl(queryObj("CurrentTemperature"))
|
||||
Dim tempCelsius As Double = (tempKelvin - 2732) / 10.0
|
||||
AggiornaTextBoxConPosizione("Temperatura CPU: " & tempCelsius.ToString("0.0") & "°C", 3)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
Console.WriteLine("Errore: " & ex.Message)
|
||||
End Try
|
||||
End Sub
|
||||
Public Function LeggiADC() As Double
|
||||
' Legge dal canale AIN0 rispetto a GND in modalità single-shot e converte in Double
|
||||
Dim valore As ElectricPotential = ads.ReadVoltage(InputMultiplexer.AIN0)
|
||||
Return valore.Volts ' Estrai il valore in Volt
|
||||
End Function
|
||||
' Variabile globale per evitare aggiornamenti ricorsivi
|
||||
Private aggiornamentoInCorso As Boolean = False
|
||||
|
||||
Private Sub AggiornaTextBoxConPosizione(nuovoTesto As String, riga As Integer)
|
||||
Dim lines As List(Of String) = TextBox1.Lines.ToList()
|
||||
|
||||
' Salva la posizione attuale del cursore
|
||||
Dim posizione As Integer = TextBox1.SelectionStart
|
||||
|
||||
' Se la TextBox è vuota, iniziamo con una riga vuota
|
||||
If lines.Count = 0 Then
|
||||
lines.Add("")
|
||||
End If
|
||||
|
||||
' Assicuriamoci che la riga esista (aggiungiamo righe vuote se necessario)
|
||||
While lines.Count <= riga
|
||||
lines.Add("")
|
||||
End While
|
||||
|
||||
' Modifica la riga specificata
|
||||
lines(riga) = nuovoTesto.Substring(0, Math.Min(nuovoTesto.Length, 20)).PadRight(20)
|
||||
|
||||
' Imposta il nuovo contenuto nella TextBox
|
||||
TextBox1.Lines = lines.ToArray()
|
||||
|
||||
' Ripristina la posizione del cursore
|
||||
posizione = Math.Min(posizione, TextBox1.Text.Length)
|
||||
TextBox1.SelectionStart = posizione
|
||||
End Sub
|
||||
|
||||
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
|
||||
Dim lines = TextBox1.Lines
|
||||
Dim i = 0
|
||||
For i = 0 To 3
|
||||
|
||||
lcd.lcdSetCursor(i, 0)
|
||||
lcd.lcdPrint(lines(i).PadRight(20))
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
testo = "ads"
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
testo = "temp"
|
||||
End Sub
|
||||
End Class
|
||||
8
FT232H/ILLink/ILLink.Descriptors.LibraryBuild.xml
Normal file
8
FT232H/ILLink/ILLink.Descriptors.LibraryBuild.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<linker>
|
||||
<assembly fullname="System.Diagnostics.DiagnosticSource">
|
||||
<type fullname="System.Diagnostics.Metrics.MetricsEventSource">
|
||||
<!-- Used by System.Private.CoreLib via reflection to init the EventSource -->
|
||||
<method name="GetInstance" />
|
||||
</type>
|
||||
</assembly>
|
||||
</linker>
|
||||
58
FT232H/LCD_i2c.vb
Normal file
58
FT232H/LCD_i2c.vb
Normal file
@@ -0,0 +1,58 @@
|
||||
Imports System.Device.I2c
|
||||
Imports System.Text
|
||||
|
||||
Public Class LCD_i2c
|
||||
|
||||
Dim i2cDeviceConnect As I2cDevice
|
||||
Public Sub New(i2cDeviceConnect As I2cDevice)
|
||||
Me.i2cDeviceConnect = i2cDeviceConnect
|
||||
InitializeLCD()
|
||||
End Sub
|
||||
|
||||
Sub InitializeLCD()
|
||||
' Modalità 4-bit
|
||||
lcdWrite(&H33, 0) ' Inizializza a 4-bit
|
||||
lcdWrite(&H32, 0) ' Conferma modalità 4-bit
|
||||
lcdWrite(&H28, 0) ' 2 righe, font 5x8
|
||||
lcdWrite(&HC, 0) ' Display ON, cursore OFF
|
||||
lcdWrite(&H6, 0) ' Scrittura da sinistra a destra
|
||||
lcdWrite(&H1, 0) ' Pulisce il display
|
||||
Threading.Thread.Sleep(5) ' Pausa per completare l'operazione di clear display
|
||||
End Sub
|
||||
Sub lcdClear()
|
||||
lcdWrite(&H1, 0)
|
||||
Threading.Thread.Sleep(5) ' Pausa
|
||||
End Sub
|
||||
Sub lcdWrite(value As Byte, mode As Byte)
|
||||
' Calcola la parte alta e bassa del comando
|
||||
Dim high As Byte = (value And &HF0) Or &H8 Or mode
|
||||
Dim low As Byte = ((value << 4) And &HF0) Or &H8 Or mode
|
||||
|
||||
' Scrivi la parte alta (E alta, E bassa)
|
||||
i2cDeviceConnect.Write(New Byte() {high})
|
||||
i2cDeviceConnect.Write(New Byte() {high Or &H4}) ' Imposta E alta
|
||||
i2cDeviceConnect.Write(New Byte() {high}) ' E bassa
|
||||
|
||||
' Scrivi la parte bassa (E alta, E bassa)
|
||||
i2cDeviceConnect.Write(New Byte() {low})
|
||||
i2cDeviceConnect.Write(New Byte() {low Or &H4}) ' Imposta E alta
|
||||
i2cDeviceConnect.Write(New Byte() {low}) ' E bassa
|
||||
End Sub
|
||||
|
||||
Sub lcdSetCursor(line As Integer, Optional pos As Integer = 0)
|
||||
Dim addresses As Byte() = New Byte() {&H80, &HC0, &H94, &HD4} ' Indirizzi per LCD 4 righe
|
||||
If line >= 0 And line <= 3 Then
|
||||
lcdWrite(addresses(line) + CByte(pos), 0) ' Aggiungi la posizione al comando di indirizzo
|
||||
End If
|
||||
Threading.Thread.Sleep(5) ' Pausa
|
||||
End Sub
|
||||
Sub lcdPrint(Message As String)
|
||||
' Scrive l'intero messaggio in un'unica operazione
|
||||
Dim messageBytes As Byte() = Encoding.ASCII.GetBytes(Message)
|
||||
For i As Integer = 0 To messageBytes.Length - 1
|
||||
lcdWrite(messageBytes(i), 1) ' Invia i caratteri come dati
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
127
FT232H/Module1.vb
Normal file
127
FT232H/Module1.vb
Normal file
@@ -0,0 +1,127 @@
|
||||
'Imports Iot.Device.Board
|
||||
'Imports Iot.Device.Ft232H
|
||||
'Imports Iot.Device.FtCommon
|
||||
'Imports System.Device.I2c
|
||||
'Imports System.IO
|
||||
'Imports System.Text
|
||||
'Imports System.Threading
|
||||
|
||||
'Module Module1
|
||||
' Dim i2cDevice As I2cDevice
|
||||
' Dim modeBit As Integer = 8
|
||||
|
||||
' Sub Main()
|
||||
' ' Disabilita la stampa degli errori sulla console
|
||||
|
||||
' ' Ottieni i dispositivi connessi
|
||||
' Dim devices = FtCommon.GetDevices()
|
||||
' Console.WriteLine($"{devices.Count} available device(s)")
|
||||
|
||||
' ' Verifica se ci sono dispositivi
|
||||
' If devices.Count = 0 Then
|
||||
' Console.WriteLine("No device connected")
|
||||
' Return
|
||||
' End If
|
||||
|
||||
' ' Seleziona il primo dispositivo FT232H
|
||||
' Dim ftDevice As FtDevice = devices(0)
|
||||
' Dim ft232h As New Ft232HDevice(ftDevice)
|
||||
|
||||
' ' Crea il bus I2C
|
||||
' Dim i2c = ft232h.CreateOrGetI2cBus(0)
|
||||
' Dim foundAddresses = i2c.PerformBusScan()
|
||||
|
||||
' ' Stampa gli indirizzi trovati
|
||||
' If foundAddresses.Count > 0 Then
|
||||
' ' Se il dispositivo è trovato all'indirizzo 0x27 (ad esempio per un LCD I2C)
|
||||
' Dim deviceAddress As Byte = &H27
|
||||
' Console.WriteLine($"Dispositivo trovato all'indirizzo: {deviceAddress:X2}")
|
||||
|
||||
' ' Crea il dispositivo I2C
|
||||
' i2cDevice = i2c.CreateDevice(deviceAddress)
|
||||
|
||||
' ' Inizializzazione del display LCD I2C
|
||||
' Try
|
||||
' modeBit = 4
|
||||
' ' Inizializza l'LCD
|
||||
' InitializeLCDxx()
|
||||
|
||||
' ' Imposta il cursore su una posizione
|
||||
' 'lcdSetCursor(1, 0) ' Posizione (1, 0) nella prima riga
|
||||
' 'lcdSetCursor(4)
|
||||
' ' Scrivi un messaggio
|
||||
' Dim message As String = "Controllo:"
|
||||
' ' Scrive l'intero messaggio in un'unica operazione
|
||||
' Dim messageBytes As Byte() = Encoding.ASCII.GetBytes(message)
|
||||
' For i As Integer = 0 To messageBytes.Length - 1
|
||||
' lcdWritexx(messageBytes(i), 1) ' Invia i caratteri come dati
|
||||
' Next
|
||||
' Catch ex As Exception
|
||||
' Console.WriteLine($"Errore durante la scrittura o l'inizializzazione: {ex.Message}")
|
||||
' End Try
|
||||
' Else
|
||||
' Console.WriteLine("Nessun dispositivo trovato")
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Sub InitializeLCDxx()
|
||||
' If modeBit = 4 Then
|
||||
' ' Modalità 4-bit
|
||||
' lcdWritexx(&H33, 0) ' Inizializza a 4-bit
|
||||
' lcdWritexx(&H32, 0) ' Conferma modalità 4-bit
|
||||
' lcdWritexx(&H28, 0) ' 2 righe, font 5x8
|
||||
' lcdWritexx(&HC, 0) ' Display ON, cursore OFF
|
||||
' lcdWritexx(&H6, 0) ' Scrittura da sinistra a destra
|
||||
' lcdWritexx(&H1, 0) ' Pulisce il display
|
||||
' Threading.Thread.Sleep(5) ' Pausa per completare l'operazione di clear display
|
||||
' ElseIf modeBit = 8 Then
|
||||
' ' Inizializzazione display (modalità 8 bit)
|
||||
' lcdWritexx(&H38, 0) ' Funzione: modalità 8-bit, 2 righe, font 5x8
|
||||
' lcdWritexx(&HC, 0) ' Display On, cursore OFF
|
||||
' lcdWritexx(&H6, 0) ' Scrittura da sinistra a destra
|
||||
' lcdWritexx(&H1, 0) ' Clear display
|
||||
' Threading.Thread.Sleep(5) ' Pausa per completare l'operazione di clear display
|
||||
' lcdWritexx(&HE, 0) ' Cursore lampeggiante
|
||||
' Threading.Thread.Sleep(5)
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Sub lcdWritexx(value As Byte, mode As Byte)
|
||||
' If modeBit = 4 Then
|
||||
' ' Calcola la parte alta e bassa del comando
|
||||
' Dim high As Byte = (value And &HF0) Or &H8 Or (mode << 0)
|
||||
' Dim low As Byte = ((value << 4) And &HF0) Or &H8 Or (mode << 0)
|
||||
|
||||
' ' Scrivi la parte alta (E alta, E bassa)
|
||||
' i2cDevice.Write(New Byte() {high})
|
||||
' i2cDevice.Write(New Byte() {high Or &H4}) ' Imposta E alta
|
||||
' i2cDevice.Write(New Byte() {high}) ' E bassa
|
||||
|
||||
' ' Scrivi la parte bassa (E alta, E bassa)
|
||||
' i2cDevice.Write(New Byte() {low})
|
||||
' i2cDevice.Write(New Byte() {low Or &H4}) ' Imposta E alta
|
||||
' i2cDevice.Write(New Byte() {low}) ' E bassa
|
||||
' ElseIf modeBit = 8 Then
|
||||
' ' Scrittura a 8 bit
|
||||
' Dim byteToSend As Byte = (value And &HFF) Or &H8 Or (mode << 0)
|
||||
|
||||
' ' Scrivi il comando/dato (byte a 8 bit)
|
||||
' i2cDevice.Write(New Byte() {byteToSend})
|
||||
|
||||
' ' Aggiungi una pausa dopo la scrittura (tempo di abilitazione E)
|
||||
' i2cDevice.Write(New Byte() {byteToSend Or &H4}) ' Imposta E alta
|
||||
' Threading.Thread.Sleep(1) ' Breve ritardo per stabilizzare
|
||||
' i2cDevice.Write(New Byte() {byteToSend}) ' Imposta E bassa per completare la scrittura
|
||||
|
||||
' ' Attendere un breve periodo per garantire che il display elabori il comando
|
||||
' Threading.Thread.Sleep(2)
|
||||
' End If
|
||||
' End Sub
|
||||
|
||||
' Sub lcdSetCursor(line As Integer, Optional pos As Integer = 0)
|
||||
' Dim addresses As Byte() = New Byte() {&H80, &HC0, &H94, &HD4} ' Indirizzi per LCD 4 righe
|
||||
' If line >= 1 And line <= 4 Then
|
||||
' lcdWritexx(addresses(line - 1) + CByte(pos), 0) ' Aggiungi la posizione al comando di indirizzo
|
||||
' End If
|
||||
' End Sub
|
||||
'End Module
|
||||
74
FT232H/Modulo_ft232H.vb
Normal file
74
FT232H/Modulo_ft232H.vb
Normal file
@@ -0,0 +1,74 @@
|
||||
Imports System.Device.I2c
|
||||
Imports Iot.Device.Board
|
||||
Imports Iot.Device.Ft232H
|
||||
Imports Iot.Device.FtCommon
|
||||
|
||||
Module Modulo_ft232H
|
||||
Public Function ElencoDispositivi() As List(Of FtDevice)
|
||||
Return FtCommon.GetDevices()
|
||||
End Function
|
||||
|
||||
Public Function SelezionaDispositivo(x As Integer) As I2cBus
|
||||
' Seleziona il primo dispositivo FT232H
|
||||
Dim ftDevice As FtDevice = ElencoDispositivi()(x)
|
||||
Dim ft232h As New Ft232HDevice(ftDevice)
|
||||
|
||||
' Crea il bus I2C
|
||||
Return ft232h.CreateOrGetI2cBus(0)
|
||||
End Function
|
||||
Public Function SelezionaDispositivo(dispositivo As I2cBus, i2c_address As Byte) As I2cDevice
|
||||
Return dispositivo.CreateDevice(i2c_address)
|
||||
End Function
|
||||
Public Function SelezionaDispositivo(NumeroSerie As String, i2c_address As Byte) As I2cDevice
|
||||
Dim i2c = SelezionaDispositivo(NumeroSerie)
|
||||
Return SelezionaDispositivo(i2c, i2c_address)
|
||||
|
||||
End Function
|
||||
''' <summary>
|
||||
''' Seleziona il dispositivo principale ft232H con numero di serie
|
||||
''' </summary>
|
||||
''' <param name="numerioSerie">numero di serie</param>
|
||||
''' <returns></returns>
|
||||
Public Function SelezionaDispositivo(numerioSerie As String) As I2cBus
|
||||
' Seleziona il primo dispositivo FT232H
|
||||
For Each ftDevice In ElencoDispositivi()
|
||||
If ftDevice.SerialNumber = numerioSerie Then
|
||||
Dim ft232h As New Ft232HDevice(ftDevice)
|
||||
' Crea il bus I2C
|
||||
Return ft232h.CreateOrGetI2cBus(0)
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
Public Function ElencoDispositivi(dispositivo As I2cBus) As List(Of String)
|
||||
' Esegui la scansione dei dispositivi sul bus I2C
|
||||
Dim dispositiviTrovati As List(Of Integer) = dispositivo.PerformBusScan()
|
||||
|
||||
' Crea una nuova lista per memorizzare i risultati in formato esadecimale
|
||||
Dim dispositiviEsadecimali As New List(Of String)
|
||||
|
||||
' Aggiungi i dispositivi alla lista, formattati come stringhe esadecimali
|
||||
For Each dispositivox In dispositiviTrovati
|
||||
dispositiviEsadecimali.Add("&H" + dispositivox.ToString("X2")) ' "X2" formatta in esadecimale con 2 cifre
|
||||
Next
|
||||
|
||||
' Restituisci la lista dei dispositivi come stringhe esadecimali
|
||||
Return dispositiviEsadecimali
|
||||
End Function
|
||||
Public Function ScansionaDispositivo_byte(dispositivo As I2cBus) As List(Of Byte)
|
||||
' Esegui la scansione dei dispositivi sul bus I2C
|
||||
Dim dispositiviTrovati As List(Of Integer) = dispositivo.PerformBusScan()
|
||||
|
||||
' Crea una nuova lista per memorizzare i risultati come byte
|
||||
Dim dispositiviByte As New List(Of Byte)
|
||||
|
||||
' Aggiungi i dispositivi alla lista come byte
|
||||
For Each dispositivox In dispositiviTrovati
|
||||
dispositiviByte.Add(CByte(dispositivox)) ' Converte il numero intero in byte
|
||||
Next
|
||||
|
||||
' Restituisci la lista dei dispositivi come byte
|
||||
Return dispositiviByte
|
||||
End Function
|
||||
|
||||
End Module
|
||||
38
FT232H/My Project/Application.Designer.vb
generated
Normal file
38
FT232H/My Project/Application.Designer.vb
generated
Normal file
@@ -0,0 +1,38 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
|
||||
' or if you encounter build errors in this file, go to the Project Designer
|
||||
' (go to Project Properties or double-click the My Project node in
|
||||
' Solution Explorer), and make changes on the Application tab.
|
||||
'
|
||||
Partial Friend Class MyApplication
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Public Sub New()
|
||||
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
Me.IsSingleInstance = false
|
||||
Me.EnableVisualStyles = true
|
||||
Me.SaveMySettingsOnExit = true
|
||||
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Protected Overrides Sub OnCreateMainForm()
|
||||
Me.MainForm = Global.FT232H.Form1
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
11
FT232H/My Project/Application.myapp
Normal file
11
FT232H/My Project/Application.myapp
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>Form1</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<ApplicationType>0</ApplicationType>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
32
FT232H/My Project/AssemblyInfo.vb
Normal file
32
FT232H/My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,32 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
' set di attributi. Modificare i valori di questi attributi per modificare le informazioni
|
||||
' associate a un assembly.
|
||||
|
||||
' Controllare i valori degli attributi degli assembly
|
||||
|
||||
<Assembly: AssemblyTitle("FT232H")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("FT232H")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2025")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'Se il progetto viene esposto a COM, il GUID seguente verrà usato come ID del typelib
|
||||
<Assembly: Guid("c2fdee2a-efd7-4b4a-ab83-82b94f3417e9")>
|
||||
|
||||
' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
'
|
||||
' Versione principale
|
||||
' Versione secondaria
|
||||
' Numero di build
|
||||
' Revisione
|
||||
'
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
62
FT232H/My Project/Resources.Designer.vb
generated
Normal file
62
FT232H/My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,62 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("FT232H.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
FT232H/My Project/Resources.resx
Normal file
117
FT232H/My Project/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
73
FT232H/My Project/Settings.Designer.vb
generated
Normal file
73
FT232H/My Project/Settings.Designer.vb
generated
Normal file
@@ -0,0 +1,73 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.FT232H.My.MySettings
|
||||
Get
|
||||
Return Global.FT232H.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
7
FT232H/My Project/Settings.settings
Normal file
7
FT232H/My Project/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
68
FT232H/TemperatureReader.vb
Normal file
68
FT232H/TemperatureReader.vb
Normal file
@@ -0,0 +1,68 @@
|
||||
Imports LibreHardwareMonitor.Hardware
|
||||
|
||||
Public Class TemperatureReader
|
||||
Private Class UpdateVisitor
|
||||
Implements IVisitor
|
||||
|
||||
Public Sub VisitHardware(hardware As IHardware) Implements IVisitor.VisitHardware
|
||||
hardware.Update()
|
||||
For Each sensor In hardware.Sensors
|
||||
sensor.Accept(Me)
|
||||
Next
|
||||
For Each subHardware In hardware.SubHardware
|
||||
subHardware.Accept(Me)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub VisitSensor(sensor As ISensor) Implements IVisitor.VisitSensor
|
||||
End Sub
|
||||
|
||||
Public Sub VisitParameter(parameter As IParameter) Implements IVisitor.VisitParameter
|
||||
End Sub
|
||||
|
||||
Public Sub VisitComputer(computer As IComputer) Implements IVisitor.VisitComputer
|
||||
For Each hardware In computer.Hardware
|
||||
hardware.Accept(Me)
|
||||
Next
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Function GetCpuTemperature() As String
|
||||
Dim computer As New Computer() With {
|
||||
.IsCpuEnabled = True
|
||||
}
|
||||
computer.Open()
|
||||
|
||||
Dim visitor As New UpdateVisitor()
|
||||
computer.Accept(visitor) ' Aggiorna tutte le informazioni hardware
|
||||
|
||||
Dim temperature As String = "N/A"
|
||||
|
||||
' Ciclo per trovare i sensori della CPU e leggere la temperatura
|
||||
For Each hardware In computer.Hardware
|
||||
If hardware.HardwareType = HardwareType.Cpu Then
|
||||
hardware.Update() ' Aggiorna i dati della CPU
|
||||
Console.WriteLine(SensorType.Temperature)
|
||||
For Each sensor In hardware.Sensors
|
||||
Console.WriteLine(sensor.SensorType)
|
||||
If sensor.SensorType = SensorType.Temperature Then
|
||||
If sensor.Value IsNot Nothing Then
|
||||
temperature = sensor.Value.ToString() & "°C"
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
computer.Close()
|
||||
Return temperature
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Module Program
|
||||
Sub Main()
|
||||
Dim reader As New TemperatureReader()
|
||||
Console.WriteLine("Temperatura CPU: " & reader.GetCpuTemperature())
|
||||
Console.ReadLine()
|
||||
End Sub
|
||||
End Module
|
||||
39
FT232H/packages.config
Normal file
39
FT232H/packages.config
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Autofac" version="4.8.1" targetFramework="net472" />
|
||||
<package id="HidSharp" version="2.1.0" targetFramework="net472" />
|
||||
<package id="Iot.Device.Bindings" version="3.2.0" targetFramework="net472" />
|
||||
<package id="LibreHardwareMonitorLib" version="0.9.4" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.3" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.HashCode" version="6.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.3" targetFramework="net472" />
|
||||
<package id="Microsoft.Extensions.Logging.Abstractions" version="9.0.3" targetFramework="net472" />
|
||||
<package id="Microsoft.Win32.Registry" version="5.0.0" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||
<package id="Powell.Devices" version="1.0.6" targetFramework="net472" />
|
||||
<package id="Powell.Devices.Things.ADS111x" version="1.0.2" targetFramework="net472" />
|
||||
<package id="Powell.Shared" version="1.0.0" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.CodeDom" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Device.Gpio" version="3.2.0" targetFramework="net472" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Drawing.Common" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.IO.Pipelines" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.IO.Ports" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Management" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.6.2" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.Reflection" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Reflection.TypeExtensions" version="4.5.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.InteropServices.WindowsRuntime" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Runtime.WindowsRuntime" version="4.7.0" targetFramework="net472" />
|
||||
<package id="System.Security.AccessControl" version="6.0.1" targetFramework="net472" />
|
||||
<package id="System.Security.Principal.Windows" version="5.0.0" targetFramework="net472" />
|
||||
<package id="System.Text.Encodings.Web" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Text.Json" version="9.0.3" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.6.2" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.Xml.XmlSerializer" version="4.3.0" targetFramework="net472" />
|
||||
<package id="UnitsNet" version="5.73.0" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user