Skip to content

nethawkChen/.net.iot.pcf8591t

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

PCF8591t AD/DA 轉換器

.Net IoT Library API 中找不到 PCF8591t 的driver,但可使用 Pcx857x 來代替 PCF8591t 本身已有光敏電阻, 這個實驗在額外加一個光敏電阻, 兩者都可以感應

using System.Device.I2c;
using Iot.Device.Pcx857x;

// PCF8591t default address 0x48
var connectionSettings = new I2cConnectionSettings(1, 0x48);
var i2cDevice = I2cDevice.Create(connectionSettings);
var pcf8591t = new Pcf8574(i2cDevice);  // 使用Pcf8574 driver

while(true){
  double value = pcf8591t.ReadByte();
  Console.WriteLine($"{value}%");
  Thread.Sleep(200);
}

Pcf8591t

接線圖

About

Raspberry pi 使用 .net 對 Pcf8591t 讀取資料

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages