ROBOTC.net forums http://www.robotc.net/forums/ |
|
Pointing Downwards http://www.robotc.net/forums/viewtopic.php?f=15&t=5489 |
Page 1 of 1 |
Author: | Coder A [ Tue Feb 12, 2013 9:05 pm ] | |||||||||
Post subject: | Pointing Downwards | |||||||||
This code is pretty self-explanatory; I just want to say the most enjoyable part of producing this code was thinking through the math and seeing the result. If I may say so, interesting code, but rather lame result! It's not without its uses, though.
The dIMU should be placed on the right side of the nxt, the LED pointing rightward, and the sensor's port pointing to the bottom of the NXT, connected to port 1. Have fun! -Coder A |
Author: | mightor [ Wed Feb 13, 2013 1:21 pm ] |
Post subject: | Re: Pointing Downwards |
Hey Avery, Would you mind if I turned this program into an example program to go with my Suite? = Xander |
Author: | Coder A [ Wed Feb 13, 2013 1:55 pm ] |
Post subject: | Re: Pointing Downwards |
I would be honored! Of course you may. Just remember to include the information on the position of the sensor on the NXT. If you want, you can change the code or delete the credits. |
Author: | mightor [ Wed Feb 13, 2013 2:08 pm ] |
Post subject: | Re: Pointing Downwards |
The file will have the same format as my other examples, but I'll be sure to give credit to you for writing the original code, but maybe not as far as thanking your parents, I'll leave that to you ![]() = Xander |
Author: | Coder A [ Wed Feb 13, 2013 2:14 pm ] |
Post subject: | Re: Pointing Downwards |
Don't worry about my parents. Like I said, alter the code however you wish. This is so cool! Another thing: all of your sample programs have "drivers/dexterind-imu.h" as their driver file location. My computer couldn't locate that file so I changed it to "dexterind-imu.h" and it worked. Make sure you change that part back however you need it. |
Author: | mightor [ Wed Feb 13, 2013 2:55 pm ] | ||
Post subject: | Re: Pointing Downwards | ||
Hey Avery, I have attached the example as I had it in mind to add to the suite. I can't test it because I seem to have misplaced my dIMU somewhere (I'm a very unhappy camper atm). Could please you test it to make sure it works? Thanks! = Xander
|
Author: | Coder A [ Wed Feb 13, 2013 3:15 pm ] |
Post subject: | Re: Pointing Downwards |
Everything worked. Just make sure that users know how to position the accel on the NXT, as this does affect the program and is different from configuration. Also line 158 has an error: I don't think the Netherlands are still in December! You're welcome! -Coder A |
Author: | mightor [ Wed Feb 13, 2013 3:23 pm ] | |||||||||
Post subject: | Re: Pointing Downwards | |||||||||
I've added the additional usage directions. As for the date, it's not a mistake, the info is automatically updated when I check the code into my Subversion Repository. This particular timestamp is from test2, I copied some of the stuff from it ![]() For more information on SVN and tags, check out this book here: http://svnbook.red-bean.com/ . I use SVN to keep track of changes I make to my code. When I am happy with a specific version, I tag it and create a release. = Xander |
Author: | Coder A [ Wed Feb 13, 2013 3:57 pm ] |
Post subject: | Re: Pointing Downwards |
Thanks for doing all this. If you have any more questions ask and I'll do my best to answer. |
Author: | Coder A [ Sat Mar 16, 2013 8:13 pm ] | |||||||||
Post subject: | Re: Pointing Downwards | |||||||||
It has been a while, but here is some new code:
What got changed: 1. I originally used the arcsine and arccosine functions and lots of additional math to determine downwards. Later, I realized that arctangent did most of the work. That got rid of lots of the extra math. 2. The arrow now changes size based on the total force felt. It gets smaller when the nxt is laid down on a table flatly and gets larger when the nxt is completely upright. The most important thing is that the code has been much simplified. |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |