![]() |
Live C++ help
I'm at the school all day, but none of my programming students are expected to be here today. The school network doesn't block google docs, and it has a live chat component. So if you've got a C++ or maybe a Java (I know Java, but I don't know the WPILib specifics) question today, head to this document and ask a question:
https://docs.google.com/spreadsheet/...=en_US# gid=0 To open the chat window, click the coloured square in the top right I'd probably be best at: -Syntax/"why isn't this compiling" question -How to use the camera -How to use the gyro/accelerometer -Some amount of cRio debugging So, ask away! Make my day go by quicker! You can also ask in the thread, but I may not notice it right away. |
Re: Live C++ help
Alright, I'm done.
This was pretty workable though - the only problem is that google docs doesn't make a noise when a collaborator chats, so sometimes I didn't notice when I had a new message. |
Re: Live C++ help
Hey there, I saw this thread and was wondering if you could help me get the accelerometer (and possibly the gyro) setup. The following is copied and pasted from the official FIRST forums.
I have my accelerometer plugged into the digital sidecar via the I2C bus. I try to set it up but just get compile errors. Can't understand why. Can someone help me out? Code below. Bold indicates complie errors. Code:
ADXL345_I2C *accelerometer; |
Re: Live C++ help
Try the following:
Code:
ADXL345_I2C *accelerometer; |
Re: Live C++ help
Alright, now it complies. But when I look at the console all I see is a bunch of zeros. I read in the accelerometer manual I have to apply power, but I'm unsure how to do that. (something with the PowerCtlFields)
|
Re: Live C++ help
Hey Does anybody know how to get a camera tracker to work? Ours just prints out random lines. The program basically makes random lines in all directions to look for different colors. If anyone wants to help me please contact me somehow.
|
Re: Live C++ help
Quote:
|
Re: Live C++ help
Quote:
|
Re: Live C++ help
Quote:
![]() ![]() |
Re: Live C++ help
If that dosen't work, could someone show me how to hook it up the other way (and the code accompanying it).
|
Re: Live C++ help
Two things:
1. It doesn't solve your problem but your picture showed that the +5 wire is black and the GND wire is red. The robot inspector will probably frown on this since this is opposite to the convention. 2. Could you change your line to the following instead? If you are not moving, the X axis will read zero. But Z will give you approx. 1 (since earth has 1G). Or you should move the accelerometer board around to see if the reading changes. Code:
std::cout<<accelerometer->GetAcceleration(Axes kAxis_Z); |
Re: Live C++ help
1. I didn't really realize the opposite wiring convention, kinda just plugged it in
2. When it was x, i turned it in all direction and it still remained 0. All I can think right now is defective/static/faulty connectors(digital board), bad cables, etc... Could you tell me how to hook it up the other way and see if that works? I have no idea how to do it. |
Re: Live C++ help
If you have a voltmeter, you can check the voltage between the +5 and the GND pins on the accelerometer to make sure it indeed gets power (in case you have bad connector). If you have an oscilloscope, check the SCK line, it should give you a train of square wave. No matter what color wires you hook it up, make sure +5 is connected to +5, Gnd to Gnd, SCL to SCL and SDA to SDA. By convention, +5 should be RED and Gnd should be BLACK.
|
Re: Live C++ help
Alright... Thanks for all the help, I really appreciate it. I'll try it out tomorrow.
|
Re: Live C++ help
Hello,
I use the i2c pins closest to the NXT connector. I read in a post that the ones you are plugged into are a slower i2c bus, but I don't have the formal documentation on that. Try the other pins and double check that you have the order on the 2x2 cables correct to the board. It is easy to turn one around with these types of cables. When I go in tonight, I'll try my working system on the pins you are on and see if it works there too. Regards, Bob |
| All times are GMT -5. The time now is 09:28 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi