Hi Guys,
I run Love Electronics in England, and I'm putting together some tutorials on how to use the netduino. The first is a series of articles on creating an inertial measurement unit with the netduino. This particlar tutorial deals with accelerometers, and how we can use their readings to calculate the tilt of the device.
The article walks you through how your accelerometer works, and what benefits and problems it introduces. We then explain how to get your netduino hooked up to the sensor, by means of I2C, with the library we have released for it. Once we have the sensor connected, you are walking though collecting that data and visualising it with a WPF application, before filters are explained in a simple to understand way.
Accelerometers and how to use them: netduino
I think it may be of use to some of you guys here, and would appreciate it if you guys thought it usefull, to give it a tweet or like on facebook.
Thanks!
James
(Love Electronics)
- Netduino Forums
- → Viewing Profile: Topics: loveelectronics
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 11
- Profile Views 4428
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
2
Neutral
User Tools
Friends
loveelectronics hasn't added any friends yet.
Topics I've Started
Accelerometers and how to use them.
21 July 2011 - 03:42 PM
Using multiple I2C devices. (I2CDevice)
27 June 2011 - 12:41 PM
I have two I2C devices in my project, both are of type I2CDevice, they look like this:
When I try to instansiate another two I2C devices, I get the following error:
I belive this is because the I2CDevice class is trying to reserve pins A4 and A5 to use the I2C bus, but really it should share these pins, and it should be my responsibility to ensure thread saftey.
How can I get round this?
/// <summary> /// Encapsulates communication and management of the Analog Devices ADXL345 3-axis accelerometer. /// </summary> public class ADXL345 : I2CDevice /// <summary> /// Encapsulates communication and management of the ST Microelectronics L3G4200D 3-axis gyroscope. /// </summary> public class L3G4200D : I2CDevice /// <summary> /// Create an ADXL345 on a custom address. /// </summary> /// <param name="address"></param> public ADXL345(ushort address, int clockRateKhz) : base(new Configuration(address, clockRateKhz)) { m_Address = address; } /// <summary> /// Create an L3G4200D on a custom address. /// </summary> /// <remarks>CS is tied to VDD high to enable I2C.</remarks> /// <param name="address"></param> public L3G4200D(ushort address, int clockRateKhz) : base(new Configuration(address, clockRateKhz)) { m_Address = address; }
When I try to instansiate another two I2C devices, I get the following error:
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) #### #### Message: #### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] #### #### Microsoft.SPOT.Hardware.I2CDevice::.ctor [IP: 0021] #### #### LoveElectronics.Sensors.Gyroscopes.L3G4200D::.ctor [IP: 0012] #### #### LoveElectronics.Tutorials.Accelerometers.MicroApp.Program::Main [IP: 007c] #### A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll
I belive this is because the I2CDevice class is trying to reserve pins A4 and A5 to use the I2C bus, but really it should share these pins, and it should be my responsibility to ensure thread saftey.
How can I get round this?
- Netduino Forums
- → Viewing Profile: Topics: loveelectronics
- Privacy Policy