| Arduino Forum ::  Members :: jraskell
 Show Posts Pages: 1 2 3 [4] 5 6 ... 53
 46 Using Arduino / Sensors / Re: ADXL345 Sensor perplexity on: September 20, 2012, 07:44:10 am QuoteBut when I reset it (the Arduino) on a non-zero-degree surface (x and y), for instance on 45 degrees on y axis, instead of giving me 120 on it, it gives me that interval of values highlighted up with 250 value on z axis.As Arctic_Eddie pointed out, your init function is calibrating the offset on startup for your x, y, and z axis.  This will result in whatever orientation you startup in as being your 0, 0, 250 position, since that is the position you are calibrating to.  Either do as he recommended (use a separate calibration sketch, and load those calibrated values in your primary sketch), or make sure the unit only ever starts up in it's proper orientation.  If the latter isn't practical, then the former is the method you need to use.
 47 Using Arduino / Programming Questions / Re: Library Tutorial doesn't seem to work on: September 19, 2012, 02:53:42 pm Post the code that's generating those error message, and I'm sure you'll get all the hope you need.  Without the code, any help provided will just be shots in the dark.
 48 Using Arduino / Programming Questions / Re: Battery discharge curve mapping on: September 19, 2012, 10:53:17 am That graph is meant to show the useable capacity of a given battery at different discharge rates.  The basic gist being, the faster you discharge the battery, the less actual capacity you have.  It's not really useful for determining a percentage capacity left over (though there is a correlation).An 'accurate' percentage is going to be difficult to computer and maintain, and likely not really worth the effort.  The simplest method is an approximate percentage based on battery voltage.  If you know the average current draw that the battery will be providing, then you can tailor your percentage to that current draw from the above discharge rate chart.  If it's a steady state current draw, just use the charts above as is.  If it's more of an intermittent current draw, then the capacity will be a bit better than the 'average' current would indicate (as the battery has time to rest in between demands for current, which gives the internal chemistry time to normalize and improves overall capacity) Here's one thread on voltage to capacity conversions: http://www.helifreak.com/showthread.php?t=333661There are others.  Again, a simple voltage measurement is only going to give you an approximation of capacity.
 49 Using Arduino / Programming Questions / Re: clear screen/ flushing the serial monitor. on: September 19, 2012, 09:45:09 am The serial monitor does have a maximum buffer size, and once it hits this size, it will grow no larger (instead, dumping old data in the window as new data comes in).  This max buffer size is relatively large with respect to occasional serial data coming in, but it shouldn't cause any sort of memory issue unless you are working on a seriously memory constrained computer.
 50 Using Arduino / Programming Questions / Re: Creating Libraries from sketches? on: September 19, 2012, 09:01:32 am A couple recommendations:Using delay() in any sort of sketch that needs to be responsive and handle multiple tasks is just a bad idea.  Don't do it.  Blink without delay is the proper way of timing actions without blocking other activities.Implement a state machine for your rover.  Google it, Wiki it (don't get caught up in complicated state machine patterns, you just need a switch/case based state machine).  If you have trouble with implementation come back and ask some questions.  The state machine itself should be pretty simple.  Incorporating it with millis() based timing (ie Blink without delay) is a little more involved, but still not really complicated.
 51 Using Arduino / Programming Questions / Re: Creating Libraries from sketches? on: September 19, 2012, 08:17:07 am Quote from: abucksdiver on September 19, 2012, 07:54:18 amMy calculations would make it about 2.5 seconds, as the loop should run for 25 cycles... (the loop is stepping in 10s...)I'll try running it later, and timing it to see if there is a point at which it moves to the next function...Many thanksSo for 2.5 seconds, your rover is going to accelerate forward with no ability to abort?  Does that really seem like a good idea?
 52 Using Arduino / Programming Questions / Re: Get out of a loop / goto: on: September 19, 2012, 07:17:45 am QuoteIt has to delay for 15 seconds it will just scroll through each display at lighting speed and no one would see anything.I understand that, and what I'm telling you is that if you delay(15000), you will not be able to do anything else at all during those 15 seconds.  There are other methods of causing portions of your sketch to wait 15 seconds while the rest of the sketch continues to execute.  Blink without delay is one of those methods.  Look at it.  Learn it.  Use it.
 53 Using Arduino / Programming Questions / Re: toward RC CAR on: September 19, 2012, 07:15:23 am Code://centerif(joyh >= 410 || joyh <=450){  servodireccao.write(115);  }This should be:Code://centerif(joyh >= 410 && joyh <=450){  servodireccao.write(115);  }The former will be true for ALL values of joyh, the latter will only be true when joyh is between 410 and 450.
 54 Using Arduino / Programming Questions / Re: Get out of a loop / goto: on: September 19, 2012, 07:04:14 am Using an actual loop instead of goto is the first step.The second step is to NOT use delay().  While you 'delay()', you can do nothing else.  So, since you want to do something else (in this case, monitor for a button push), you have to eliminate all your delays.Look at the blink without delay sample for the recommended method of doing this.On a side note, I think it's a little absurd that the TVout library implements it's own method of delay().  Utterly pointless.
 55 Using Arduino / Motors, Mechanics, and Power / Re: Need your approval for right motor shield on: September 18, 2012, 07:04:09 am .6A is greater than .4A.  So why would you worry about the motor burning out the controller?
 56 Topics / Robotics / Re: Optical encoding with Sabertooth 2x25 broken on: September 17, 2012, 01:08:53 pm QuoteI was afraid of wiring the ground on the arduino to the 12v ground. But it sounds like that is the right thing to do?Nothing to be afraid of there.  It is the right thing to do and it is necessary to do.  So long as you keep the positive lines separate, you will be fine.
 57 Topics / Robotics / Re: Optical encoding with Sabertooth 2x25 broken on: September 16, 2012, 12:22:36 pm QuoteShould I ground the Arduino to the batteries?That question in particular makes me go hmm.  Are you using multiple power sources (batteries, power supplies, whatever)?  If so, you have to make sure you have a common ground for everything to work properly together.  On the flip side, you don't want to get carried away with tying all sorts of grounds together or you could create a ground loop that will also be a source of noise.If you're using two batteries, tie their grounds together, then send this common ground to each device that needs power, and of course tie the positive of the appropriate battery to each device as well. One battery will power the Sabertooth motor controller, and the other will power the Arduino and encoder.  Do not tie grounds together between devices though.
 58 Using Arduino / Programming Questions / Re: How to save a constant updating value on: September 14, 2012, 01:31:55 pm The MPU-6000/6050 have an integrated IMU processor.  All you have to do is read the heading data output on the I2C.What did you kinda get working?  and what problems did you run into?This should be a good starting point for working with any of the MPU-6050 breakout boards:http://arduino.cc/playground/Main/MPU-6050
 59 Community / Bar Sport / Re: Interstellar Travel on: September 14, 2012, 12:36:58 pm QuoteWhether you live on that little imaginary island or living on a planet in an empty region of the Milky Way, the arguments are similar.The arguments are indeed similar, but the scales are completely and utterly out of whack.That author needs the same reality check.  These people clearly have little comprehension of just how far a light year really is.  May as well start planning intergalactic travel.  After all, what's a few more orders of magnitude?Let's master intrastellar travel before we put any focus on interstellar travel.
 60 Using Arduino / Programming Questions / Re: How to save a constant updating value on: September 14, 2012, 12:03:34 pm In all likelihood you are going to need both to accomplish your goal.  Either by themselves are inadequate (for different reasons) for tracking angular position.  Put the two together though, and they can compensate for their separate inadequacies and provide a decent IMU.
 Pages: 1 2 3 [4] 5 6 ... 53