Hi, I have your accelerometer extension and I am having trouble getting it working. I’ve added the provided “driver” code. When I call FEZ_Extensions.Accelerometer.Initialize() it throws an error. The error seems to be thrown on the ReadRegister(0x14) call near the end of FEZ_Extensions.Accelerometer.Initialize(). Any help would be appreciated.
Also I thought I might mention that the circuitry on the accelerometer looks quite a bit different then in the picture on the website. It has MOD-24LR printed on it. I thought I’d mention this just in case I wasn’t sent an accelerometer.
@ Foekie, I didn’t think it was necessary to provide those things since the problem was so specific. Sorta like telling people what engine you having in your car when you need help with your breaks Seems like it could confuse the issue more then help but since I’m new here and you’re not I’ll go ahead and take your advice and provide them from now on. It’s V 4.0.3.0
the main reason that question gets asked, particularly when it’s someone’s first post, is because it’s the #1 reason for “unexplained” exceptions. You’ve now progressed past that point, so you’re probably ok not to bother telling us that from now on
Another great outcome and a great sign of how the GHI folks put so much emphasis on making us all happy !
I have a Fez Mini with the SMB380 accelerometer, but when i lunch the program with the genuine driver the result is :
‘System.InvalidOperationException’ in Microsoft.SPOT.Hardware.dll
the error occurs in this source code :
static private void WriteRegister(byte address, byte value)
{
write[0] = address;
write[1] = value;
_spi.WriteRead(write, read); <===ERROR
}
It is better if you start a new topic instead of using older ones…just so everyone can keep track and not get confused.
The line you pointed to is fine so the problem is in the passed buffers. Did you use our code with no modifications? It should just work.
Also, did you try to start simpler, like blink LED then try th accelerometer?