_slaveDevice.Execute(writeXAction, transactionTimeout) is returning 0
- Netduino Forums
- → Viewing Profile: Posts: pajama
The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Community Stats
- Group Members
- Active Posts 4
- Profile Views 6847
- Member Title New Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
0
Neutral
User Tools
Friends
pajama hasn't added any friends yet.
Latest Visitors
Posts I've Made
In Topic: Netduino + 2 I2C with VNCL4000 Proximity Sensor
17 April 2015 - 08:15 PM
In Topic: Netduino + 2 I2C with VNCL4000 Proximity Sensor
17 April 2015 - 08:10 PM
I would try using the WriteRegister and ReadRegister methods rather than the generic Write and Read methods.
Thank you for the suggestion.
Here's what I'm doing, still getting the same error. Should my writebuffer be a different size?
public byte ReadVersion() { // write register address byte[] writeBuffer = new byte[1]; I2CBus.GetInstance().WriteRegister(_slaveConfiguration, (byte)CommandRegisters.ProductId, writeBuffer, TransactionTimeout); // get the byte result byte[] data = new byte[1]; I2CBus.GetInstance().ReadRegister(_slaveConfiguration, (byte)CommandRegisters.ProductId, data,TransactionTimeout); //force the convertion to a signed byte return data[0]; }
In Topic: Netduino + 2 I2C with VNCL4000 Proximity Sensor
16 April 2015 - 09:30 PM
- You are using a 8-bit I2C address in your code. (0x27) and it needs to be a 7-bit address (0x13).
- Your I2C clock is set too high. I do not think that the Net Micro Framework supports clock at 3400. Try setting your clock to 100 and then (if successful) try a higher clock (400).
Thank you for the reply! I changed the values above. Still throwing an exception here:
if (transferred != writeBuffer.Length)throw new Exception("Could not write to device.");
Any ideas?
- Netduino Forums
- → Viewing Profile: Posts: pajama
- Privacy Policy