-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get the MicroInfinity CruizCore XG1300L gyroscope working #34
Comments
Can you see the device in
|
I unplugged all the other sensors so only the XG1300L was attached.
Also, when I go to the Device Browser in Brickman there are no sensors listed. Do I need to install support for this sensor? |
If this sensor isn't auto-detected you'll need to configure the port to tell it what driver to use. It looks like this one is an I2C-based sensor designed for the NXT so you'd probably use the |
http://python-ev3dev.readthedocs.io/en/stable/other.html#lego-port This links python docs, but should be helpful anyway. |
@WasabiFan I had the same thought. I used a
I verified that the mode does actually change. And the port object reports that it is connected. But even so, when I create an i2c_sensor, it reports itself not connected. According to the sensor docs, it looks like "nxt-i2c" is the correct mode. I also noticed that the footnotes for the sensor say it doesn't follow the LEGO guidelines for I2c registers and cannot be automatically detected. The docs go on to say that in order to register the i2c device you execute the following command:
But when I run the command (on ports in my case), bash reports an error:
So I'm still doing it wrong. Somehow. |
@ddemidov I read through the port documentation and saw that it mentioned using
But when I call the function, it throws an exception with the same message (Operation not supported) that I saw when I tried to echo a string to the set_device file in /sys/class/lego_port. I don't know enough (basically zero) about the port interface in /sys to understand why I'm seeing that message. |
I am sorry, I have zero experience with non-standard sensors. May be @dlech could help. |
Did you give the sensor enough time after setting the mode and device? |
@ddemidov and @WasabiFan Thanks to both of you for the support. I've reposted this issue to the main ev3dev forum because it seems to be a sensor issue and not a C++ issue. |
I'm trying to use an XG1300L gyroscope attached to my EV3, but I'm not able to get it working in my C++ program. I'm looking for help getting it to connect. I assume I've just missed a simple step, but I cannot figure out where I've gone wrong.
I'm following the example code in the ev3dev-mapping code by bmegli. Specifically, I looked at how he used the gyro in the dead-reconing module. It doesn't look like he's doing anything beyond declaring the sensor.
Later the code checks
gyro->connected()
before sending a command. Easy, right? Well, maybe not. It looks like bmegli may have modified the i2c_sensor class to get it working.I certainly haven't been able to get it to work. Here's my code:
When I run the program, it always prints
FALSE
. This doesn't look like rocket surgery, so I must be passing an incorrect argument value. But I cannot find any other example code and I don't know if I need to get bmegli's patch. Someone who has used this sensor will surely be able to point me in the right direction.As a sanity check, I booted the EV3 with the LEGO firmware and then ran a sample program from the Microinfinity web site that uses the LEGO Mindstorms block-programming environment. The program was able to display readings from the sensor, so I know the hardware is good and attached properly.
Here's my ev3dev sysinfo:
The text was updated successfully, but these errors were encountered: