Comments (6)
@joperezr Yes, thanks. In my case I will add an extension method for my specific device.
from iot.
If by this you mean the I2c Address, then this is set in the I2cConnectionSettings.DeviceAddress
. The way it works is that you would generate a I2cConnectionSettings object, and then pass that in to the constructor of the UnixI2cDevice, for example:
var settings = new I2cConnectionSettings(busId: 0, deviceAddress: 0x77);
var myI2cDevyce = new UnixI2cDevice(settings);
from iot.
@joperezr In my case I use for now the following i2cset -y 1 0x69 0x00 0xFF && i2cset -y 1 0x69 0x01 0x00 && i2cset -y 1 0x69 0x02 0x00
for set a led to red.
As you can see, 1 is busId, 0x69 is for deviceAddress, 0x00, 0x01, 0x02 is for registers or data-address and at the end we have the RGB value.
I'm not sure, but I think that writting a byte array with the register and value works well. Could we add a method to simplificate this?
from iot.
reading a register from a device is not strictly standard. For example, there are some devices that in order to read register 0x00, the way you do it is that you first write 0x00 to the i2c bus chain, then you wait for one cycle, and then you read from that bus chain. There are other devices that behave different, where in order to read register 0x00, you have to first write the register you want to read with the 8-th bit flipped to 1 to the i2c bus chain and then read from it, so you would write 0x80 in order to read register 0x00. What I mean is that it wouldn't be possible to have a standard function like:
byte readRegister(byte registerAddress);
void writeRegister(byte registerAddress, byte data);
because the way to read and write registers is not standard for all devices. Today, UnixI2cDevice provides a way to Read and Write from the i2cBus chain, but each device needs to implement how reading a register is performed in that particular device (based on the device's datasheet).
Does that make sense?
from iot.
cool. I plan on adding some Spi and I2c device bindings as an example of the API consumption soon 😄
from iot.
Cool. If you need it, I could give bindings for https://www.access-is.com/products/val100
from iot.
Related Issues (20)
- Iot.Device.Media VideoDevice Capture creates corrupt images with Raspberry PI Camera module 3 HOT 17
- I2S Missing HOT 3
- Does the library support TRF7970A? HOT 3
- FT232H Cannot register for pin value change events HOT 2
- Update Raspberry Pi samples suggesting modifying config.txt settings HOT 5
- Unable to set pin mode on pi5 HOT 4
- Breaking change: Y2038 support for .NET Arm32 HOT 1
- arix.local HOT 1
- Misleading XML summary for ButtonBase.IsPressed HOT 1
- TM16xx is very unstable - shows strange characters most of the time HOT 7
- GPIO input gives segmentation fault on BeagleBone Black in v3.1.0 HOT 20
- Implement Raspberry5Driver and board HOT 1
- Add support for SPI devices that use separate GPIO outputs for Data/Command and Reset HOT 4
- If using gpio on an arm Linux system. How do I make things displayed on the interface? HOT 2
- Unable to get consistent manual exposures HOT 6
- PinNumberingScheme.Board is broken HOT 2
- SPI communication on RPI5 is possibly broken
- ButtonBase.IsPressed not properly initialized HOT 1
- Investigate protocol: matter HOT 1
- Cargo causes GpioController to hang on Raspberry Pi 5 Bookworm HOT 31
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot.